diff --git a/src/Utils/BaseSet.php b/src/Utils/BaseSet.php index 25069f2..0640fe7 100644 --- a/src/Utils/BaseSet.php +++ b/src/Utils/BaseSet.php @@ -12,7 +12,7 @@ abstract class BaseSet implements \Iterator, \ArrayAccess, \Countable protected array $array = []; - public function merge(self $objectSet, bool $allowReplace = false) : self + public function merge(self $objectSet, bool $allowReplace = false) : static { if (!$objectSet instanceof static) { throw new \Exception('I can only merge Sets of same type'); @@ -83,7 +83,7 @@ public function offsetUnset($offset) : void unset($this->array[$offset]); } - abstract protected function mergeImpl(self $objectSet, bool $allowReplace) : self; + abstract protected function mergeImpl(self $objectSet, bool $allowReplace) : static; abstract protected function offsetSetImpl($offset, object $object) : void; } diff --git a/src/Utils/Json.php b/src/Utils/Json.php index 68cecf1..4c8fc3a 100644 --- a/src/Utils/Json.php +++ b/src/Utils/Json.php @@ -15,7 +15,7 @@ private function __construct(?string $json, ?\Infinityloop\Utils\Json\JsonContra $this->inner = $data; } - public static function fromString(string $json) : self + public static function fromString(string $json) : static { return new self($json, null); } diff --git a/src/Utils/Json/JsonContract.php b/src/Utils/Json/JsonContract.php index cde2880..113e4b6 100644 --- a/src/Utils/Json/JsonContract.php +++ b/src/Utils/Json/JsonContract.php @@ -14,7 +14,7 @@ abstract class JsonContract implements \Countable, \IteratorAggregate, \ArrayAcc \JSON_UNESCAPED_SLASHES | \JSON_PRESERVE_ZERO_FRACTION; - abstract public static function fromString(string $json) : self; + abstract public static function fromString(string $json) : static; abstract public function toString() : string; diff --git a/src/Utils/Json/MapJson.php b/src/Utils/Json/MapJson.php index 03e7eeb..c8c7d27 100644 --- a/src/Utils/Json/MapJson.php +++ b/src/Utils/Json/MapJson.php @@ -15,7 +15,7 @@ private function __construct(?string $json, ?\stdClass $data) $this->data = $data; } - public static function fromString(string $json) : self + public static function fromString(string $json) : static { return new self($json, null); } diff --git a/src/Utils/Json/SequentialJson.php b/src/Utils/Json/SequentialJson.php index 612df5a..ec317b7 100644 --- a/src/Utils/Json/SequentialJson.php +++ b/src/Utils/Json/SequentialJson.php @@ -19,7 +19,7 @@ private function __construct(?string $json, ?array $data) $this->data = $data; } - public static function fromString(string $json) : self + public static function fromString(string $json) : static { return new self($json, null); } diff --git a/src/Utils/ObjectMap.php b/src/Utils/ObjectMap.php index 675cf93..908c4a0 100644 --- a/src/Utils/ObjectMap.php +++ b/src/Utils/ObjectMap.php @@ -18,7 +18,7 @@ public function key() : string return \key($this->array); } - protected function mergeImpl(BaseSet $objectSet, bool $allowReplace = false) : self + protected function mergeImpl(BaseSet $objectSet, bool $allowReplace = false) : static { foreach ($objectSet as $offset => $object) { if (!$allowReplace && $this->offsetExists($offset)) { diff --git a/src/Utils/ObjectSet.php b/src/Utils/ObjectSet.php index 64b0598..fb5b6fb 100644 --- a/src/Utils/ObjectSet.php +++ b/src/Utils/ObjectSet.php @@ -18,7 +18,7 @@ public function key() : int return \key($this->array); } - protected function mergeImpl(BaseSet $objectSet, bool $allowReplace = false) : self + protected function mergeImpl(BaseSet $objectSet, bool $allowReplace = false) : static { foreach ($objectSet as $offset => $object) { $this->offsetSet($allowReplace