From ec6825374b95c6188d09f00ac405e5204544bb18 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 1 Jan 2022 13:21:47 +0100 Subject: [PATCH] PHP 8.1 compatibility fixes --- .github/workflows/ci.yml | 2 -- Core/Frameworks/BaikalAdmin/Controller/User/AddressBooks.php | 1 - Core/Frameworks/BaikalAdmin/Controller/Users.php | 1 - Core/Frameworks/Flake/Core/Collection.php | 2 ++ composer.json | 4 ++-- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 126e30d..e861ad6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,6 @@ jobs: php-versions: ['7.2', '7.3', '7.4', '8.0'] cs-fixer: [ true ] include: - - php-versions: '7.1' - cs-fixer: false - php-versions: '8.1' cs-fixer: false steps: diff --git a/Core/Frameworks/BaikalAdmin/Controller/User/AddressBooks.php b/Core/Frameworks/BaikalAdmin/Controller/User/AddressBooks.php index dfe4a08..d08ec8b 100644 --- a/Core/Frameworks/BaikalAdmin/Controller/User/AddressBooks.php +++ b/Core/Frameworks/BaikalAdmin/Controller/User/AddressBooks.php @@ -63,7 +63,6 @@ class AddressBooks extends \Flake\Core\Controller { $aAddressBooks = []; $oAddressBooks = $this->oUser->getAddressBooksBaseRequester()->execute(); - reset($oAddressBooks); foreach ($oAddressBooks as $addressbook) { $aAddressBooks[] = [ "linkedit" => $this->linkEdit($addressbook), diff --git a/Core/Frameworks/BaikalAdmin/Controller/Users.php b/Core/Frameworks/BaikalAdmin/Controller/Users.php index 68ee53c..6ef90c0 100644 --- a/Core/Frameworks/BaikalAdmin/Controller/Users.php +++ b/Core/Frameworks/BaikalAdmin/Controller/Users.php @@ -61,7 +61,6 @@ class Users extends \Flake\Core\Controller { $aUsers = []; $oUsers = \Baikal\Model\User::getBaseRequester()->execute(); - reset($oUsers); foreach ($oUsers as $user) { $aUsers[] = [ "linkcalendars" => \BaikalAdmin\Controller\Users::linkCalendars($user), diff --git a/Core/Frameworks/Flake/Core/Collection.php b/Core/Frameworks/Flake/Core/Collection.php index 0a5c490..84b661d 100644 --- a/Core/Frameworks/Flake/Core/Collection.php +++ b/Core/Frameworks/Flake/Core/Collection.php @@ -31,10 +31,12 @@ class Collection extends \Flake\Core\FLObject implements \Iterator { protected $aCollection = []; protected $aMeta = []; + #[\ReturnTypeWillChange] function current() { return current($this->aCollection); } + #[\ReturnTypeWillChange] function key() { return key($this->aCollection); } diff --git a/composer.json b/composer.json index ff6f028..446bf25 100644 --- a/composer.json +++ b/composer.json @@ -13,9 +13,9 @@ } ], "require": { - "php" : "^7.1 || ^8.0", + "php" : "^7.2 || ^8.0", "sabre/dav" : "~4.3.0", - "twig/twig" : "~2.13.1", + "twig/twig" : "~2.14.8", "symfony/yaml" : "^3.4" }, "require-dev" : {