From 1c4c0ffac90e681197fba746b1ed15d453ae515d Mon Sep 17 00:00:00 2001 From: dereuromark Date: Wed, 18 Jan 2017 17:51:35 +0100 Subject: [PATCH] Fix up late static binding newable. --- src/Collection/Iterator/NestIterator.php | 2 +- src/Database/Expression/QueryExpression.php | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Collection/Iterator/NestIterator.php b/src/Collection/Iterator/NestIterator.php index faaed8860ee..1cb532241ac 100644 --- a/src/Collection/Iterator/NestIterator.php +++ b/src/Collection/Iterator/NestIterator.php @@ -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); } /** diff --git a/src/Database/Expression/QueryExpression.php b/src/Database/Expression/QueryExpression.php index a2caaa5f2df..96e65b4e80a 100644 --- a/src/Database/Expression/QueryExpression.php +++ b/src/Database/Expression/QueryExpression.php @@ -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)); } /** @@ -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 @@ -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); } @@ -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; }