Skip to content

Commit

Permalink
Merge branch '3.x' into 3.next
Browse files Browse the repository at this point in the history
  • Loading branch information
othercorey committed May 22, 2020
2 parents 03ced73 + 9c6026f commit 5e651e1
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 37 deletions.
10 changes: 5 additions & 5 deletions Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -737,12 +737,12 @@ public function supportsDynamicConstraints()
* });
* ```
*/
public function transactional(callable $callback)
public function transactional(callable $transaction)
{
$this->begin();

try {
$result = $callback($this);
$result = $transaction($this);
} catch (Exception $e) {
$this->rollback(false);
throw $e;
Expand Down Expand Up @@ -785,13 +785,13 @@ protected function wasNestedTransactionRolledback()
* });
* ```
*/
public function disableConstraints(callable $callback)
public function disableConstraints(callable $operation)
{
return $this->getDisconnectRetry()->run(function () use ($callback) {
return $this->getDisconnectRetry()->run(function () use ($operation) {
$this->disableForeignKeys();

try {
$result = $callback($this);
$result = $operation($this);
} catch (Exception $e) {
$this->enableForeignKeys();
throw $e;
Expand Down
4 changes: 2 additions & 2 deletions Expression/BetweenExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ public function sql(ValueBinder $generator)
* {@inheritDoc}
*
*/
public function traverse(callable $callable)
public function traverse(callable $visitor)
{
foreach ([$this->_field, $this->_from, $this->_to] as $part) {
if ($part instanceof ExpressionInterface) {
$callable($part);
$visitor($part);
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions Expression/Comparison.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,21 +166,21 @@ public function sql(ValueBinder $generator)
* {@inheritDoc}
*
*/
public function traverse(callable $callable)
public function traverse(callable $visitor)
{
if ($this->_field instanceof ExpressionInterface) {
$callable($this->_field);
$this->_field->traverse($callable);
$visitor($this->_field);
$this->_field->traverse($visitor);
}

if ($this->_value instanceof ExpressionInterface) {
$callable($this->_value);
$this->_value->traverse($callable);
$visitor($this->_value);
$this->_value->traverse($visitor);
}

foreach ($this->_valueExpressions as $v) {
$callable($v);
$v->traverse($callable);
$visitor($v);
$v->traverse($visitor);
}
}

Expand Down
8 changes: 2 additions & 6 deletions Expression/IdentifierExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,9 @@ public function sql(ValueBinder $generator)
}

/**
* This method is a no-op, this is a leaf type of expression,
* hence there is nothing to traverse
*
* @param callable $callable The callable to traverse with.
* @return void
* @inheritDoc
*/
public function traverse(callable $callable)
public function traverse(callable $visitor)
{
}
}
8 changes: 4 additions & 4 deletions Expression/QueryExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -572,15 +572,15 @@ public function sql(ValueBinder $generator)
*
* Callback function receives as only argument an instance of ExpressionInterface
*
* @param callable $callable The callable to apply to all sub-expressions.
* @param callable $visitor The callable to apply to all sub-expressions.
* @return void
*/
public function traverse(callable $callable)
public function traverse(callable $visitor)
{
foreach ($this->_conditions as $c) {
if ($c instanceof ExpressionInterface) {
$callable($c);
$c->traverse($callable);
$visitor($c);
$c->traverse($visitor);
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions Expression/TupleComparison.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,30 +134,30 @@ protected function _bindValue($generator, $value, $type)
*
* Callback function receives as its only argument an instance of an ExpressionInterface
*
* @param callable $callable The callable to apply to sub-expressions
* @param callable $visitor The callable to apply to sub-expressions
* @return void
*/
public function traverse(callable $callable)
public function traverse(callable $visitor)
{
foreach ($this->getField() as $field) {
$this->_traverseValue($field, $callable);
$this->_traverseValue($field, $visitor);
}

$value = $this->getValue();
if ($value instanceof ExpressionInterface) {
$callable($value);
$value->traverse($callable);
$visitor($value);
$value->traverse($visitor);

return;
}

foreach ($value as $i => $val) {
if ($this->isMulti()) {
foreach ($val as $v) {
$this->_traverseValue($v, $callable);
$this->_traverseValue($v, $visitor);
}
} else {
$this->_traverseValue($val, $callable);
$this->_traverseValue($val, $visitor);
}
}
}
Expand Down
8 changes: 5 additions & 3 deletions Expression/UnaryExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ class UnaryExpression implements ExpressionInterface
/**
* Indicates that the operation is in pre-order
*
* @var int
*/
const PREFIX = 0;

/**
* Indicates that the operation is in post-order
*
* @var int
*/
const POSTFIX = 1;

Expand Down Expand Up @@ -93,11 +95,11 @@ public function sql(ValueBinder $generator)
* {@inheritDoc}
*
*/
public function traverse(callable $callable)
public function traverse(callable $visitor)
{
if ($this->_value instanceof ExpressionInterface) {
$callable($this->_value);
$this->_value->traverse($callable);
$visitor($this->_value);
$this->_value->traverse($visitor);
}
}

Expand Down
3 changes: 3 additions & 0 deletions Schema/SqlserverSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
*/
class SqlserverSchema extends BaseSchema
{
/**
* @var string
*/
const DEFAULT_SCHEMA_NAME = 'dbo';

/**
Expand Down
5 changes: 4 additions & 1 deletion Statement/BufferedStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ public function execute($params = null)
}

/**
* {@inheritDoc}
* Returns the value of the result at position.
*
* @param int $position The numeric position of the column to retrieve in the result
* @return mixed Returns the specific value of the column designated at $position
*/
public function fetchColumn($position)
{
Expand Down
4 changes: 2 additions & 2 deletions Statement/SqlserverStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
class SqlserverStatement extends PDOStatement
{
/**
* {@inheritDoc}
*
* The SQL Server PDO driver requires that binary parameters be bound with the SQLSRV_ENCODING_BINARY attribute.
* This overrides the PDOStatement::bindValue method in order to bind binary columns using the required attribute.
*
* {@inheritDoc}
*/
public function bindValue($column, $value, $type = 'string')
{
Expand Down

0 comments on commit 5e651e1

Please sign in to comment.