]> git.mxchange.org Git - friendica.git/commitdiff
Some more deprecation fixups
authorPhilipp <admin@philipp.info>
Wed, 5 Jul 2023 20:20:52 +0000 (22:20 +0200)
committerPhilipp <admin@philipp.info>
Wed, 5 Jul 2023 21:16:01 +0000 (23:16 +0200)
src/Collection/Api/Notifications.php
src/Util/ACLFormatter.php
src/Util/ReversedFileReader.php
tests/Util/Intercept.php
tests/src/Database/DatabaseTest.php

index c2ccf2cffbc5d03414c3007657371fc767370bca..4bb1eaa5669562f98ad1d4039cf413f9e3de02bb 100644 (file)
@@ -29,6 +29,7 @@ class Notifications extends BaseCollection
        /**
         * @return Notification
         */
+       #[\ReturnTypeWillChange]
        public function current()
        {
                return parent::current();
index f7a0894e1c6e81bce4f6911c0361d36131529c79..cd398fc280a419c314fe6b2e7a0a5af7ae299cf6 100644 (file)
@@ -35,7 +35,7 @@ final class ACLFormatter
         *
         * @return array The array based on the IDs (empty in case there is no list)
         */
-       public function expand(string $acl_string = null)
+       public function expand(string $acl_string = null): array
        {
                // In case there is no ID list, return empty array (=> no ACL set)
                if (empty($acl_string)) {
@@ -55,7 +55,7 @@ final class ACLFormatter
         * @param string|null $acl_string
         * @return string
         */
-       public function sanitize(string $acl_string = null)
+       public function sanitize(string $acl_string = null): string
        {
                if (empty($acl_string)) {
                        return '';
@@ -107,10 +107,13 @@ final class ACLFormatter
         *
         * @return string
         */
-       function toString($permissions) {
+       function toString($permissions): string
+       {
                $return = '';
                if (is_array($permissions)) {
                        $item = $permissions;
+               } elseif (empty($permissions)) {
+                       return '';
                } else {
                        $item = explode(',', $permissions);
                }
index fdd15bec90520cdf6fa266b4cf29e6d0b70ca5bd..58fb2cb3faaceab460c86ed8192cb103625725fe 100644 (file)
@@ -89,7 +89,7 @@ class ReversedFileReader implements \Iterator
         *
         * @return string|null Depending on data being buffered
         */
-       private function _readline()
+       private function _readline(): ?string
        {
                $buffer = & $this->buffer;
                while (true) {
@@ -112,6 +112,7 @@ class ReversedFileReader implements \Iterator
         * @see Iterator::next()
         * @return void
         */
+       #[\ReturnTypeWillChange]
        public function next()
        {
                ++$this->key;
@@ -124,6 +125,7 @@ class ReversedFileReader implements \Iterator
         * @see Iterator::rewind()
         * @return void
         */
+       #[\ReturnTypeWillChange]
        public function rewind()
        {
                if ($this->filesize > 0) {
index 27b558fc5e0a109667d1da07250f4abdf34b9c31..483d274fca0c93faab9fda01cd543b8e01cce02e 100644 (file)
@@ -37,7 +37,7 @@ class Intercept extends php_user_filter
        public static $cache = '';
 
        /** @noinspection PhpMissingParentCallCommonInspection */
-       public function filter($in, $out, &$consumed, $closing)
+       public function filter($in, $out, &$consumed, $closing): int
        {
                while ($bucket = stream_bucket_make_writeable($in)) {
                        self::$cache .= $bucket->data;
index e90683461485f60b43e126fc13466c09ce5c3917..c431a5294d828f2f2df6655893fd6cf219a37c1d 100644 (file)
@@ -30,6 +30,15 @@ class DatabaseTest extends FixtureTest
 {
        use CreateDatabaseTrait;
 
+       /**
+        * @var Cache
+        */
+       protected $configCache;
+       /**
+        * @var ConfigFileManager
+        */
+       protected $configFileManager;
+
        protected function setUp(): void
        {
                $this->setUpVfsDir();