Skip to content

Commit

Permalink
Fix up late static binding newable.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Jan 18, 2017
1 parent 666281f commit 1c4c0ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Collection/Iterator/NestIterator.php
Expand Up @@ -54,7 +54,7 @@ public function getChildren()
{
$property = $this->_propertyExtractor($this->_nestKey);

return new self($property($this->current()), $this->_nestKey);
return new static($property($this->current()), $this->_nestKey);
}

/**
Expand Down
14 changes: 7 additions & 7 deletions src/Database/Expression/QueryExpression.php
Expand Up @@ -450,10 +450,10 @@ public function between($field, $from, $to, $type = null)
public function and_($conditions, $types = [])
{
if ($this->isCallable($conditions)) {
return $conditions(new self([], $this->getTypeMap()->setTypes($types)));
return $conditions(new static([], $this->getTypeMap()->setTypes($types)));
}

return new self($conditions, $this->getTypeMap()->setTypes($types));
return new static($conditions, $this->getTypeMap()->setTypes($types));
}

/**
Expand All @@ -468,10 +468,10 @@ public function and_($conditions, $types = [])
public function or_($conditions, $types = [])
{
if ($this->isCallable($conditions)) {
return $conditions(new self([], $this->getTypeMap()->setTypes($types), 'OR'));
return $conditions(new static([], $this->getTypeMap()->setTypes($types), 'OR'));
}

return new self($conditions, $this->getTypeMap()->setTypes($types), 'OR');
return new static($conditions, $this->getTypeMap()->setTypes($types), 'OR');
}
// @codingStandardsIgnoreEnd

Expand Down Expand Up @@ -685,7 +685,7 @@ protected function _addConditions(array $conditions, array $types)
}

if ($this->isCallable($c)) {
$expr = new QueryExpression([], $typeMap);
$expr = new static([], $typeMap);
$c = $c($expr, $this);
}

Expand All @@ -695,12 +695,12 @@ protected function _addConditions(array $conditions, array $types)
}

if ($numericKey && is_array($c) || in_array(strtolower($k), $operators)) {
$this->_conditions[] = new self($c, $typeMap, $numericKey ? 'AND' : $k);
$this->_conditions[] = new static($c, $typeMap, $numericKey ? 'AND' : $k);
continue;
}

if (strtolower($k) === 'not') {
$this->_conditions[] = new UnaryExpression('NOT', new self($c, $typeMap));
$this->_conditions[] = new UnaryExpression('NOT', new static($c, $typeMap));
continue;
}

Expand Down

0 comments on commit 1c4c0ff

Please sign in to comment.