Skip to content

Commit

Permalink
Fix travis errors/warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
smgallo committed Jan 17, 2017
1 parent 5340065 commit de9d888
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions classes/ETL/DbEntity/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function __construct($config, $systemQuoteChar = null, Log $logger = null

if ( ! is_object($config) && is_string($config) ) {
$config = $this->parseJsonFile($config, "Query Definition");
} else if ( ! $config instanceof stdClass) {
} elseif ( ! $config instanceof stdClass) {
$msg = __CLASS__ . ": Argument is not a filename or object";
$this->logAndThrowException($msg);
}
Expand Down Expand Up @@ -158,22 +158,22 @@ protected function initialize(stdClass $config, $force = false)

if ( ! isset($config->records) ) {
$errorMsg[] = "records property not found";
} else if ( ! is_object($config->records) ) {
} elseif ( ! is_object($config->records) ) {
$errorMsg[] = "records property must be an object";
}

if ( ! isset($config->joins) ) {
$errorMsg[] = "joins property not found";
} else if ( ! is_array($config->joins) ) {
} elseif ( ! is_array($config->joins) ) {
$errorMsg[] = "joins property must be an array";
} else if ( 0 == count($config->joins) ) {
} elseif ( 0 == count($config->joins) ) {
$errorMsg[] = "joins property must include as least one element";
}

if ( isset($config->groupby) ) {
if ( ! is_array($config->groupby) ) {
$errorMsg[] = "groupby property must be an array";
} else if ( 0 == count($config->groupby) ) {
} elseif ( 0 == count($config->groupby) ) {
$errorMsg[] = "groupby property must include as least one element";
}
}
Expand Down Expand Up @@ -269,7 +269,7 @@ public function addRecord($columnName, $formula)
if ( null === $formula || "" === $formula ) {
$msg = "Empty formula for column '$columnName' '$formula'";
$this->logAndThrowException($msg);
} else if ( array_key_exists($columnName, $this->records) ) {
} elseif ( array_key_exists($columnName, $this->records) ) {
$msg = "Column '$columnName' already has a formula specified";
$this->logAndThrowException($msg);
}
Expand Down Expand Up @@ -577,7 +577,7 @@ public function addOverseerRestriction($restriction, $template)
if ( ! is_string($restriction) || "" == $restriction ) {
$msg = "Overseer restriction key must be a non-empty string";
$this->logAndThrowException($msg);
} else if ( ! is_string($template) || "" == $template ) {
} elseif ( ! is_string($template) || "" == $template ) {
$msg = "Overseer restriction template must be a non-empty string";
$this->logAndThrowException($msg);
}
Expand Down Expand Up @@ -633,7 +633,7 @@ public function addOverseerRestrictionValue($restriction, $value)
if ( ! is_string($restriction) || "" == $restriction ) {
$msg = "Overseer restriction key must be a non-empty string";
$this->logAndThrowException($msg);
} else if ( ! is_string($value) || "" == $value ) {
} elseif ( ! is_string($value) || "" == $value ) {
$msg = "Overseer restriction template must be a non-empty string";
$this->logAndThrowException($msg);
}
Expand Down Expand Up @@ -701,7 +701,6 @@ public function getSelectSql($includeSchema = true)
$joinList[] = "FROM " . $this->joins[0]->getCreateSql($includeSchema);

for ( $i = 1; $i < count($this->joins); $i++ ) {

if ( null === $this->joins[$i]->getOn() ) {
$msg = "Join clause for table '" . $this->joins[$i]->getName() . "' does not provide ON condition";
}
Expand All @@ -717,12 +716,11 @@ public function getSelectSql($includeSchema = true)

if ( "STRAIGHT" == $joinType ) {
$joinStr = "STRAIGHT_JOIN";
} else if ( null !== $joinType) {
} elseif (null !== $joinType) {
$joinStr = $joinType . " JOIN";
}

$joinList[] = $joinStr . " " . $this->joins[$i]->getCreateSql($includeSchema);

} // for ( $i = 1; $i < count($this->joins); $i++ )

// Construct the SELECT statement
Expand All @@ -739,7 +737,7 @@ public function getSelectSql($includeSchema = true)
// If any macros have been defined, process those macros now. Since macros can contain variables
// themselves, we will process the variables later.

if ( count($this->macros) > 0 ) {
if (count($this->macros) > 0) {
foreach ( $this->macros as $macro ) {
$sql = Utilities::processMacro($sql, $macro);
}
Expand Down

0 comments on commit de9d888

Please sign in to comment.