]> git.mxchange.org Git - friendica.git/commitdiff
Add \ReturnTypeWillChange attribute to methods inherited from native interfaces
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 23 Nov 2022 18:36:49 +0000 (13:36 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Fri, 25 Nov 2022 13:13:05 +0000 (08:13 -0500)
- Part of https://github.com/friendica/friendica/issues/12011#issuecomment-1321796513

src/BaseCollection.php
src/Core/Session/Handler/Database.php
src/Object/Email.php

index f6fa9bbd4dec7329215b81cb644f3260a4f0c2eb..ad68dc81ccce49c398c3bbb09acdf105e4bc961b 100644 (file)
@@ -48,25 +48,27 @@ class BaseCollection extends \ArrayIterator
        /**
         * @inheritDoc
         */
-       public function offsetSet($offset, $value)
+       #[\ReturnTypeWillChange]
+       public function offsetSet($key, $value): void
        {
-               if (is_null($offset)) {
+               if (is_null($key)) {
                        $this->totalCount++;
                }
 
-               parent::offsetSet($offset, $value);
+               parent::offsetSet($key, $value);
        }
 
        /**
         * @inheritDoc
         */
-       public function offsetUnset($offset)
+       #[\ReturnTypeWillChange]
+       public function offsetUnset($key): void
        {
-               if ($this->offsetExists($offset)) {
+               if ($this->offsetExists($key)) {
                        $this->totalCount--;
                }
 
-               parent::offsetUnset($offset);
+               parent::offsetUnset($key);
        }
 
        /**
index 41ccb6b33f834e4f315fef4b6b78a5f2813bebff..337397be6057ca44a90e9a9ff7616d6798617c67 100644 (file)
@@ -57,6 +57,7 @@ class Database extends AbstractSessionHandler
                return true;
        }
 
+       #[\ReturnTypeWillChange]
        public function read($id)
        {
                if (empty($id)) {
@@ -136,6 +137,7 @@ class Database extends AbstractSessionHandler
                }
        }
 
+       #[\ReturnTypeWillChange]
        public function gc($max_lifetime): bool
        {
                try {
index 4d5a11715cace161baed3287072d48c27c8e914f..fdde4e96ddd751a329f4e16e434acdaddd79607f 100644 (file)
@@ -200,6 +200,7 @@ class Email implements IEmail
        /**
         * @inheritDoc
         */
+       #[\ReturnTypeWillChange]
        public function jsonSerialize()
        {
                return $this->toArray();