From daa576ad6328f52aeb6b3e19690a3eb330a8c262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Fri, 1 Sep 2023 11:18:01 +0200 Subject: [PATCH] fix merge --- src/Model/Scope.php | 2 +- src/Model/Scope/AbstractScope.php | 7 +++++-- src/Model/Scope/Condition.php | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) 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;