Skip to content

Commit

Permalink
Use Elvis operators instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Theaxiom committed Apr 17, 2017
1 parent 534fb76 commit 06e222a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/Console/ConsoleIo.php
Expand Up @@ -101,10 +101,10 @@ class ConsoleIo
*/
public function __construct(ConsoleOutput $out = null, ConsoleOutput $err = null, ConsoleInput $in = null, HelperRegistry $helpers = null)
{
$this->_out = $out ? $out : new ConsoleOutput('php://stdout');
$this->_err = $err ? $err : new ConsoleOutput('php://stderr');
$this->_in = $in ? $in : new ConsoleInput('php://stdin');
$this->_helpers = $helpers ? $helpers : new HelperRegistry();
$this->_out = $out ?: new ConsoleOutput('php://stdout');
$this->_err = $err ?: new ConsoleOutput('php://stderr');
$this->_in = $in ?: new ConsoleInput('php://stdin');
$this->_helpers = $helpers ?: new HelperRegistry();
$this->_helpers->setIo($this);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Core/functions.php
Expand Up @@ -66,7 +66,7 @@ function h($text, $double = true, $charset = null)
$charset = $double;
}

return htmlspecialchars($text, ENT_QUOTES | ENT_SUBSTITUTE, ($charset) ? $charset : $defaultCharset, $double);
return htmlspecialchars($text, ENT_QUOTES | ENT_SUBSTITUTE, $charset ?: $defaultCharset, $double);
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Schema/PostgresSchema.php
Expand Up @@ -171,7 +171,7 @@ public function convertColumnDescription(TableSchema $schema, $row)

if ($field['type'] === 'numeric' || $field['type'] === 'decimal') {
$field['length'] = $row['column_precision'];
$field['precision'] = $row['column_scale'] ? $row['column_scale'] : null;
$field['precision'] = $row['column_scale'] ?: null;
}
$schema->addColumn($row['name'], $field);
}
Expand Down

0 comments on commit 06e222a

Please sign in to comment.