diff --git a/src/Model/Scope.php b/src/Model/Scope.php index a3db0a4fa2..3a13f751b3 100644 --- a/src/Model/Scope.php +++ b/src/Model/Scope.php @@ -89,7 +89,7 @@ public function addCondition($field, $operator = null, $value = null) return $this; } - protected function setSystem($system = true) + protected function setSystem(bool $system = true) { foreach ($this->elements as $nestedCondition) { $nestedCondition->setSystem($system && $this->isAnd()); diff --git a/src/Model/Scope/AbstractScope.php b/src/Model/Scope/AbstractScope.php index badfa0f7c5..2257e2ce50 100644 --- a/src/Model/Scope/AbstractScope.php +++ b/src/Model/Scope/AbstractScope.php @@ -34,14 +34,17 @@ protected function init(): void $this->_init(); // always set system flag if condition added to another condition - $this->setSystem($this->owner instanceof RootScope); + $this->setSystem($owner instanceof RootScope); $this->onChangeModel(); } abstract protected function onChangeModel(): void; - abstract protected function setSystem($system = true); + /** + * @return $this + */ + abstract protected function setSystem(bool $system = true); /** * Get the model this condition is associated with. diff --git a/src/Model/Scope/Condition.php b/src/Model/Scope/Condition.php index 2c1a563254..8be81e6c00 100644 --- a/src/Model/Scope/Condition.php +++ b/src/Model/Scope/Condition.php @@ -151,7 +151,7 @@ public function __construct($key, $operator = null, $value = null) } } - protected function setSystem($system = true) + protected function setSystem(bool $system = true) { $this->system = $system;