From f8d4a5080dba46ec5aabb0f9c630ae681a558a10 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 30 Nov 2022 14:48:17 +0000 Subject: [PATCH 01/12] Update dependency vimeo/psalm to v5 | datasource | package | from | to | | ---------- | ----------- | ------ | ----- | | packagist | vimeo/psalm | 4.30.0 | 5.0.0 | Signed-off-by: Renovate Bot --- composer.json | 2 +- composer.lock | 176 ++++++++++++++++++++++++++------------------------ 2 files changed, 93 insertions(+), 85 deletions(-) diff --git a/composer.json b/composer.json index ed051cbb..6fb5dada 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,7 @@ "mongodb/mongodb": "~1.13.0", "phpunit/phpunit": "^9.5.26", "psalm/plugin-phpunit": "^0.18.0", - "vimeo/psalm": "^4.30" + "vimeo/psalm": "^5.0" }, "suggest": { "laminas/laminas-cache": "Laminas\\Cache component", diff --git a/composer.lock b/composer.lock index 769c02e9..e2e7155e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d560169eacfc56328edde5b196422e20", + "content-hash": "dea9f95c3fff0c3de3a17554ec05110e", "packages": [ { "name": "laminas/laminas-eventmanager", @@ -4321,6 +4321,69 @@ ], "time": "2022-01-02T09:55:41+00:00" }, + { + "name": "symfony/filesystem", + "version": "v6.0.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "3adca49133bd055ebe6011ed1e012be3c908af79" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/3adca49133bd055ebe6011ed1e012be3c908af79", + "reference": "3adca49133bd055ebe6011ed1e012be3c908af79", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v6.0.13" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-09-21T20:25:27+00:00" + }, { "name": "symfony/polyfill-ctype", "version": "v1.27.0", @@ -4954,24 +5017,24 @@ }, { "name": "vimeo/psalm", - "version": "4.30.0", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "d0bc6e25d89f649e4f36a534f330f8bb4643dd69" + "reference": "4e177bf0c9f03c17d2fbfd83b7cc9c47605274d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/d0bc6e25d89f649e4f36a534f330f8bb4643dd69", - "reference": "d0bc6e25d89f649e4f36a534f330f8bb4643dd69", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/4e177bf0c9f03c17d2fbfd83b7cc9c47605274d8", + "reference": "4e177bf0c9f03c17d2fbfd83b7cc9c47605274d8", "shasum": "" }, "require": { "amphp/amp": "^2.4.2", "amphp/byte-stream": "^1.5", - "composer/package-versions-deprecated": "^1.8.0", + "composer/package-versions-deprecated": "^1.10.0", "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.1 || ^2.0 || ^3.0", + "composer/xdebug-handler": "^2.0 || ^3.0", "dnoegel/php-xdg-base-dir": "^0.1.1", "ext-ctype": "*", "ext-dom": "*", @@ -4980,35 +5043,34 @@ "ext-mbstring": "*", "ext-simplexml": "*", "ext-tokenizer": "*", - "felixfbecker/advanced-json-rpc": "^3.0.3", - "felixfbecker/language-server-protocol": "^1.5", + "felixfbecker/advanced-json-rpc": "^3.1", + "felixfbecker/language-server-protocol": "^1.5.2", "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", "nikic/php-parser": "^4.13", "openlss/lib-array2xml": "^1.0", - "php": "^7.1|^8", - "sebastian/diff": "^3.0 || ^4.0", - "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0 || ^6.0", - "symfony/polyfill-php80": "^1.25", - "webmozart/path-util": "^2.3" + "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0", + "sebastian/diff": "^4.0", + "symfony/console": "^4.1.6 || ^5.0 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/polyfill-php80": "^1.25" }, "provide": { "psalm/psalm": "self.version" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.2", - "brianium/paratest": "^4.0||^6.0", + "bamarni/composer-bin-plugin": "^1.4", + "brianium/paratest": "^6.0", "ext-curl": "*", + "mockery/mockery": "^1.5", + "nunomaduro/mock-final-classes": "^1.1", "php-parallel-lint/php-parallel-lint": "^1.2", - "phpdocumentor/reflection-docblock": "^5", - "phpmyadmin/sql-parser": "5.1.0||dev-master", - "phpspec/prophecy": ">=1.9.0", - "phpstan/phpdoc-parser": "1.2.* || 1.6.4", - "phpunit/phpunit": "^9.0", - "psalm/plugin-phpunit": "^0.16", - "slevomat/coding-standard": "^7.0", - "squizlabs/php_codesniffer": "^3.5", - "symfony/process": "^4.3 || ^5.0 || ^6.0", - "weirdan/prophecy-shim": "^1.0 || ^2.0" + "phpstan/phpdoc-parser": "^1.6", + "phpunit/phpunit": "^9.5", + "psalm/plugin-mockery": "^1.1", + "psalm/plugin-phpunit": "^0.18", + "slevomat/coding-standard": "^8.4", + "squizlabs/php_codesniffer": "^3.6", + "symfony/process": "^4.4 || ^5.0 || ^6.0" }, "suggest": { "ext-curl": "In order to send data to shepherd", @@ -5024,17 +5086,14 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev", + "dev-master": "5.x-dev", + "dev-4.x": "4.x-dev", "dev-3.x": "3.x-dev", "dev-2.x": "2.x-dev", "dev-1.x": "1.x-dev" } }, "autoload": { - "files": [ - "src/functions.php", - "src/spl_object_id.php" - ], "psr-4": { "Psalm\\": "src/Psalm/" } @@ -5056,9 +5115,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.30.0" + "source": "https://github.com/vimeo/psalm/tree/5.0.0" }, - "time": "2022-11-06T20:37:08+00:00" + "time": "2022-11-30T06:06:01+00:00" }, { "name": "webimpress/coding-standard", @@ -5172,57 +5231,6 @@ "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, "time": "2022-06-03T18:03:27+00:00" - }, - { - "name": "webmozart/path-util", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/path-util.git", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "webmozart/assert": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\PathUtil\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", - "support": { - "issues": "https://github.com/webmozart/path-util/issues", - "source": "https://github.com/webmozart/path-util/tree/2.3.0" - }, - "abandoned": "symfony/filesystem", - "time": "2015-12-17T08:42:14+00:00" } ], "aliases": [], From 1c3e7cad7034540e52df3d7ac19fff7126fc36c3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 2 Dec 2022 00:31:30 +0000 Subject: [PATCH 02/12] Lock file maintenance Signed-off-by: Renovate Bot --- composer.lock | 56 +++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/composer.lock b/composer.lock index 769c02e9..44664249 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "laminas/laminas-eventmanager", - "version": "3.6.0", + "version": "3.7.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-eventmanager.git", - "reference": "3f1afbad86cd34a431fdc069f265cfe6f8fc8308" + "reference": "b954c360182b9160026a8393d7b1b716dcae25d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-eventmanager/zipball/3f1afbad86cd34a431fdc069f265cfe6f8fc8308", - "reference": "3f1afbad86cd34a431fdc069f265cfe6f8fc8308", + "url": "https://api.github.com/repos/laminas/laminas-eventmanager/zipball/b954c360182b9160026a8393d7b1b716dcae25d7", + "reference": "b954c360182b9160026a8393d7b1b716dcae25d7", "shasum": "" }, "require": { @@ -30,11 +30,11 @@ "require-dev": { "laminas/laminas-coding-standard": "~2.4.0", "laminas/laminas-stdlib": "^3.15", - "phpbench/phpbench": "^1.2.6", - "phpunit/phpunit": "^9.5.25", - "psalm/plugin-phpunit": "^0.17.0", + "phpbench/phpbench": "^1.2.7", + "phpunit/phpunit": "^9.5.26", + "psalm/plugin-phpunit": "^0.18.0", "psr/container": "^1.1.2 || ^2.0.2", - "vimeo/psalm": "^4.28" + "vimeo/psalm": "^5.0.0" }, "suggest": { "laminas/laminas-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature", @@ -72,20 +72,20 @@ "type": "community_bridge" } ], - "time": "2022-10-11T12:46:13+00:00" + "time": "2022-12-01T16:12:47+00:00" }, { "name": "laminas/laminas-servicemanager", - "version": "3.19.0", + "version": "3.20.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-servicemanager.git", - "reference": "ed160729bb8721127efdaac799f9a298963345b1" + "reference": "bc2c2cbe2dd90db8b9d16b0618f542692b76ab59" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-servicemanager/zipball/ed160729bb8721127efdaac799f9a298963345b1", - "reference": "ed160729bb8721127efdaac799f9a298963345b1", + "url": "https://api.github.com/repos/laminas/laminas-servicemanager/zipball/bc2c2cbe2dd90db8b9d16b0618f542692b76ab59", + "reference": "bc2c2cbe2dd90db8b9d16b0618f542692b76ab59", "shasum": "" }, "require": { @@ -108,14 +108,14 @@ "require-dev": { "composer/package-versions-deprecated": "^1.11.99.5", "laminas/laminas-coding-standard": "~2.4.0", - "laminas/laminas-container-config-test": "^0.7", + "laminas/laminas-container-config-test": "^0.8", "laminas/laminas-dependency-plugin": "^2.2", "mikey179/vfsstream": "^1.6.11@alpha", "ocramius/proxy-manager": "^2.14.1", - "phpbench/phpbench": "^1.2.6", - "phpunit/phpunit": "^9.5.25", - "psalm/plugin-phpunit": "^0.17.0", - "vimeo/psalm": "^4.28" + "phpbench/phpbench": "^1.2.7", + "phpunit/phpunit": "^9.5.26", + "psalm/plugin-phpunit": "^0.18.0", + "vimeo/psalm": "^5.0.0" }, "suggest": { "ocramius/proxy-manager": "ProxyManager ^2.1.1 to handle lazy initialization of services" @@ -162,20 +162,20 @@ "type": "community_bridge" } ], - "time": "2022-10-10T20:59:22+00:00" + "time": "2022-12-01T17:03:38+00:00" }, { "name": "laminas/laminas-stdlib", - "version": "3.15.0", + "version": "3.16.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-stdlib.git", - "reference": "63b66bd4b696f024f42616b9d95cdb10e5109c27" + "reference": "0880e3dd88eca01eeda9dfdb5a05c38e56902c2c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/63b66bd4b696f024f42616b9d95cdb10e5109c27", - "reference": "63b66bd4b696f024f42616b9d95cdb10e5109c27", + "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/0880e3dd88eca01eeda9dfdb5a05c38e56902c2c", + "reference": "0880e3dd88eca01eeda9dfdb5a05c38e56902c2c", "shasum": "" }, "require": { @@ -186,10 +186,10 @@ }, "require-dev": { "laminas/laminas-coding-standard": "^2.4.0", - "phpbench/phpbench": "^1.2.6", - "phpunit/phpunit": "^9.5.25", - "psalm/plugin-phpunit": "^0.17.0", - "vimeo/psalm": "^4.28" + "phpbench/phpbench": "^1.2.7", + "phpunit/phpunit": "^9.5.26", + "psalm/plugin-phpunit": "^0.18.0", + "vimeo/psalm": "^5.0.0" }, "type": "library", "autoload": { @@ -221,7 +221,7 @@ "type": "community_bridge" } ], - "time": "2022-10-10T19:10:24+00:00" + "time": "2022-11-30T23:45:45+00:00" }, { "name": "psr/container", From ddb0de0f2abf17f0e0ff8ade5168762bdfe7b4e7 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 05:39:45 +0100 Subject: [PATCH 03/12] Documenting template parameters on symbols extending iterator-alike objects --- src/AbstractContainer.php | 4 ++++ src/Container.php | 4 ++++ src/Storage/AbstractSessionArrayStorage.php | 5 +++++ src/Storage/ArrayStorage.php | 5 +++++ src/Storage/SessionArrayStorage.php | 6 +++++- src/Storage/SessionStorage.php | 4 ++++ src/Storage/StorageInterface.php | 5 +++++ test/TestAsset/Php81CompatibleStorageInterface.php | 5 +++++ test/TestAsset/TestContainer.php | 5 +++++ 9 files changed, 42 insertions(+), 1 deletion(-) diff --git a/src/AbstractContainer.php b/src/AbstractContainer.php index 80b525fa..ce274b5a 100644 --- a/src/AbstractContainer.php +++ b/src/AbstractContainer.php @@ -26,6 +26,10 @@ * may have their own expiries, or even expiries per key in the container. * Additionally, expiries may be absolute TTLs or measured in "hops", which * are based on how many times the key or container were accessed. + * + * @template-covariant TKey of string + * @template-covariant TValue + * @template-extends ArrayObject */ abstract class AbstractContainer extends ArrayObject { diff --git a/src/Container.php b/src/Container.php index e3c0c990..9f21a632 100644 --- a/src/Container.php +++ b/src/Container.php @@ -9,6 +9,10 @@ * may have their own expiries, or even expiries per key in the container. * Additionally, expiries may be absolute TTLs or measured in "hops", which * are based on how many times the key or container were accessed. + * + * @template-covariant TKey of string + * @template-covariant TValue + * @template-extends AbstractContainer */ class Container extends AbstractContainer { diff --git a/src/Storage/AbstractSessionArrayStorage.php b/src/Storage/AbstractSessionArrayStorage.php index 659f3104..5e3c43d8 100644 --- a/src/Storage/AbstractSessionArrayStorage.php +++ b/src/Storage/AbstractSessionArrayStorage.php @@ -27,6 +27,11 @@ * property access, metadata storage, locking, and immutability. * * @see ReturnTypeWillChange + * + * @template-covariant TKey of string + * @template-covariant TValue + * @template-implements IteratorAggregate + * @template-implements StorageInterface */ abstract class AbstractSessionArrayStorage implements IteratorAggregate, diff --git a/src/Storage/ArrayStorage.php b/src/Storage/ArrayStorage.php index ee855572..0389dd6c 100644 --- a/src/Storage/ArrayStorage.php +++ b/src/Storage/ArrayStorage.php @@ -22,6 +22,11 @@ * for setting metadata, locking, and marking as isImmutable. * * @see ReturnTypeWillChange + * + * @template-covariant TKey of string + * @template-covariant TValue + * @template-extends ArrayObject + * @template-implements StorageInterface */ class ArrayStorage extends ArrayObject implements StorageInterface { diff --git a/src/Storage/SessionArrayStorage.php b/src/Storage/SessionArrayStorage.php index 065b12bb..c8be506b 100644 --- a/src/Storage/SessionArrayStorage.php +++ b/src/Storage/SessionArrayStorage.php @@ -3,7 +3,11 @@ namespace Laminas\Session\Storage; /** - * Session storage in $_SESSION + * Session storage in $_SESSION' + * + * @template-covariant TKey of array-key + * @template-covariant TValue + * @template-extends AbstractSessionArrayStorage */ class SessionArrayStorage extends AbstractSessionArrayStorage { diff --git a/src/Storage/SessionStorage.php b/src/Storage/SessionStorage.php index 79342fe1..688ba416 100644 --- a/src/Storage/SessionStorage.php +++ b/src/Storage/SessionStorage.php @@ -12,6 +12,10 @@ * * Replaces the $_SESSION superglobal with an ArrayObject that allows for * property access, metadata storage, locking, and immutability. + * + * @template-covariant TKey + * @template-covariant TValue + * @template-extends ArrayStorage */ class SessionStorage extends ArrayStorage { diff --git a/src/Storage/StorageInterface.php b/src/Storage/StorageInterface.php index b80927e5..b2519781 100644 --- a/src/Storage/StorageInterface.php +++ b/src/Storage/StorageInterface.php @@ -12,6 +12,11 @@ * * Defines the minimum requirements for handling userland, in-script session * storage (e.g., the $_SESSION superglobal array). + * + * @template-covariant TKey of array-key + * @template-covariant TValue + * @template-extends Traversable + * @template-extends ArrayAccess */ interface StorageInterface extends Traversable, ArrayAccess, Serializable, Countable { diff --git a/test/TestAsset/Php81CompatibleStorageInterface.php b/test/TestAsset/Php81CompatibleStorageInterface.php index ce468a76..c3bb0895 100644 --- a/test/TestAsset/Php81CompatibleStorageInterface.php +++ b/test/TestAsset/Php81CompatibleStorageInterface.php @@ -6,6 +6,11 @@ use Laminas\Session\Storage\StorageInterface; +/** + * @template-covariant TKey of array-key + * @template-covariant TValue + * @template-extends StorageInterface + */ interface Php81CompatibleStorageInterface extends StorageInterface { public function __serialize(): array; diff --git a/test/TestAsset/TestContainer.php b/test/TestAsset/TestContainer.php index 1635099b..ad14a2bf 100644 --- a/test/TestAsset/TestContainer.php +++ b/test/TestAsset/TestContainer.php @@ -6,6 +6,11 @@ use Laminas\Session\AbstractContainer; +/** + * @template-covariant TKey of string + * @template-covariant TValue + * @template-extends AbstractContainer + */ class TestContainer extends AbstractContainer { // do nothing From 966125e54227b2f31ca16acade7ee569e5fb4a74 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 05:39:58 +0100 Subject: [PATCH 04/12] Removed unused psalm suppressions from psalm configuration --- psalm.xml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/psalm.xml b/psalm.xml index c4e98ee1..bece6c29 100644 --- a/psalm.xml +++ b/psalm.xml @@ -14,19 +14,6 @@ - - - - - - - - - - - - - From 1dd01b882e24c1c91619a6ad0fd71a064b099c05 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 05:40:16 +0100 Subject: [PATCH 05/12] Making test `final` and state `private` --- test/StorageTest.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/StorageTest.php b/test/StorageTest.php index 08eaf8cd..d6e529cc 100644 --- a/test/StorageTest.php +++ b/test/StorageTest.php @@ -11,10 +11,9 @@ /** * @covers \Laminas\Session\Storage\ArrayStorage */ -class StorageTest extends TestCase +final class StorageTest extends TestCase { - /** @var ArrayStorage */ - protected $storage; + private ArrayStorage $storage; protected function setUp(): void { From 1a57017e06812569b625541efa5dc6baf0102dbc Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 05:40:32 +0100 Subject: [PATCH 06/12] Upgraded `vimeo/psalm` to latest & greatest version --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index ae5000a0..755fa6f2 100644 --- a/composer.lock +++ b/composer.lock @@ -5017,16 +5017,16 @@ }, { "name": "vimeo/psalm", - "version": "5.0.0", + "version": "5.1.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "4e177bf0c9f03c17d2fbfd83b7cc9c47605274d8" + "reference": "4defa177c89397c5e14737a80fe4896584130674" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/4e177bf0c9f03c17d2fbfd83b7cc9c47605274d8", - "reference": "4e177bf0c9f03c17d2fbfd83b7cc9c47605274d8", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/4defa177c89397c5e14737a80fe4896584130674", + "reference": "4defa177c89397c5e14737a80fe4896584130674", "shasum": "" }, "require": { @@ -5115,9 +5115,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/5.0.0" + "source": "https://github.com/vimeo/psalm/tree/5.1.0" }, - "time": "2022-11-30T06:06:01+00:00" + "time": "2022-12-02T01:23:35+00:00" }, { "name": "webimpress/coding-standard", From 22dceb8540ca693e98f43e24b277b42bbdb2642d Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 05:55:29 +0100 Subject: [PATCH 07/12] Removed covariance marker from container types, removed redundant docblock overrides causing type clashes Note: we assume https://github.com/laminas/laminas-stdlib/pull/78 will be merged first. --- src/AbstractContainer.php | 19 ++++------------ src/Container.php | 4 ++-- src/Storage/AbstractSessionArrayStorage.php | 22 ++++++++----------- src/Storage/ArrayStorage.php | 4 ++-- src/Storage/SessionArrayStorage.php | 4 ++-- src/Storage/SessionStorage.php | 4 ++-- src/Storage/StorageInterface.php | 4 ++-- src/Validator/AbstractValidatorChainEM3.php | 4 ++-- src/ValidatorChain.php | 4 ++-- .../Php81CompatibleStorageInterface.php | 4 ++-- test/TestAsset/TestContainer.php | 4 ++-- 11 files changed, 31 insertions(+), 46 deletions(-) diff --git a/src/AbstractContainer.php b/src/AbstractContainer.php index ce274b5a..34c5b578 100644 --- a/src/AbstractContainer.php +++ b/src/AbstractContainer.php @@ -27,8 +27,8 @@ * Additionally, expiries may be absolute TTLs or measured in "hops", which * are based on how many times the key or container were accessed. * - * @template-covariant TKey of string - * @template-covariant TValue + * @template TKey of string + * @template TValue * @template-extends ArrayObject */ abstract class AbstractContainer extends ArrayObject @@ -462,14 +462,7 @@ public function offsetUnset($key) unset($storage[$name][$key]); } - /** - * Exchange the current array with another array or object. - * - * @see ArrayObject::exchangeArray() - * - * @param array|object $input - * @return array Returns the old array - */ + /** @inheritDoc */ public function exchangeArray($input) { // handle arrayobject, iterators and the like: @@ -605,11 +598,7 @@ public function setExpirationHops($hops, $vars = null) return $this; } - /** - * Creates a copy of the specific container name - * - * @return array - */ + /** @inheritDoc */ public function getArrayCopy() { $storage = $this->verifyNamespace(); diff --git a/src/Container.php b/src/Container.php index 9f21a632..7469fbee 100644 --- a/src/Container.php +++ b/src/Container.php @@ -10,8 +10,8 @@ * Additionally, expiries may be absolute TTLs or measured in "hops", which * are based on how many times the key or container were accessed. * - * @template-covariant TKey of string - * @template-covariant TValue + * @template TKey of string + * @template TValue * @template-extends AbstractContainer */ class Container extends AbstractContainer diff --git a/src/Storage/AbstractSessionArrayStorage.php b/src/Storage/AbstractSessionArrayStorage.php index 5e3c43d8..58f61759 100644 --- a/src/Storage/AbstractSessionArrayStorage.php +++ b/src/Storage/AbstractSessionArrayStorage.php @@ -28,8 +28,8 @@ * * @see ReturnTypeWillChange * - * @template-covariant TKey of string - * @template-covariant TValue + * @template TKey of array-key + * @template TValue * @template-implements IteratorAggregate * @template-implements StorageInterface */ @@ -198,11 +198,7 @@ public function unserialize($session) return unserialize($session); } - /** - * Get Iterator - * - * @return ArrayIterator - */ + /** @inheritDoc */ #[ReturnTypeWillChange] public function getIterator() { @@ -252,7 +248,7 @@ public function isImmutable() * Lock this storage instance, or a key within it * * @param null|int|string $key - * @return ArrayStorage + * @return $this */ public function lock($key = null) { @@ -309,7 +305,7 @@ public function isLocked($key = null) * Unlock an object or key marked as locked * * @param null|int|string $key - * @return ArrayStorage + * @return $this */ public function unlock($key = null) { @@ -353,7 +349,7 @@ public function unlock($key = null) * @param string $key * @param mixed $value * @param bool $overwriteArray Whether to overwrite or merge array values; by default, merges - * @return ArrayStorage + * @return $this * @throws Exception\RuntimeException */ public function setMetadata($key, $value, $overwriteArray = false) @@ -417,7 +413,7 @@ public function getMetadata($key = null) * Clear the storage object or a subkey of the object * * @param null|int|string $key - * @return ArrayStorage + * @return $this * @throws Exception\RuntimeException */ public function clear($key = null) @@ -452,7 +448,7 @@ public function getRequestAccessTime() * Set the request access time * * @param float $time - * @return ArrayStorage + * @return $this */ protected function setRequestAccessTime($time) { @@ -465,7 +461,7 @@ protected function setRequestAccessTime($time) * Cast the object to an array * * @param bool $metaData Whether to include metadata - * @return array + * @return array */ public function toArray($metaData = false) { diff --git a/src/Storage/ArrayStorage.php b/src/Storage/ArrayStorage.php index 0389dd6c..996e6038 100644 --- a/src/Storage/ArrayStorage.php +++ b/src/Storage/ArrayStorage.php @@ -23,8 +23,8 @@ * * @see ReturnTypeWillChange * - * @template-covariant TKey of string - * @template-covariant TValue + * @template TKey of array-key + * @template TValue * @template-extends ArrayObject * @template-implements StorageInterface */ diff --git a/src/Storage/SessionArrayStorage.php b/src/Storage/SessionArrayStorage.php index c8be506b..cdfac79e 100644 --- a/src/Storage/SessionArrayStorage.php +++ b/src/Storage/SessionArrayStorage.php @@ -5,8 +5,8 @@ /** * Session storage in $_SESSION' * - * @template-covariant TKey of array-key - * @template-covariant TValue + * @template TKey of array-key + * @template TValue * @template-extends AbstractSessionArrayStorage */ class SessionArrayStorage extends AbstractSessionArrayStorage diff --git a/src/Storage/SessionStorage.php b/src/Storage/SessionStorage.php index 688ba416..5b4094b1 100644 --- a/src/Storage/SessionStorage.php +++ b/src/Storage/SessionStorage.php @@ -13,8 +13,8 @@ * Replaces the $_SESSION superglobal with an ArrayObject that allows for * property access, metadata storage, locking, and immutability. * - * @template-covariant TKey - * @template-covariant TValue + * @template TKey of array-key + * @template TValue * @template-extends ArrayStorage */ class SessionStorage extends ArrayStorage diff --git a/src/Storage/StorageInterface.php b/src/Storage/StorageInterface.php index b2519781..6ef8e740 100644 --- a/src/Storage/StorageInterface.php +++ b/src/Storage/StorageInterface.php @@ -13,8 +13,8 @@ * Defines the minimum requirements for handling userland, in-script session * storage (e.g., the $_SESSION superglobal array). * - * @template-covariant TKey of array-key - * @template-covariant TValue + * @template TKey of array-key + * @template TValue * @template-extends Traversable * @template-extends ArrayAccess */ diff --git a/src/Validator/AbstractValidatorChainEM3.php b/src/Validator/AbstractValidatorChainEM3.php index 075b7e36..a1d25a49 100644 --- a/src/Validator/AbstractValidatorChainEM3.php +++ b/src/Validator/AbstractValidatorChainEM3.php @@ -42,8 +42,8 @@ public function __construct(StorageInterface $storage) * @param int $priority * @return CallbackHandler */ - public function attach($eventName, callable $callback, $priority = 1) + public function attach($eventName, callable $listener, $priority = 1) { - return $this->attachValidator($eventName, $callback, $priority); + return $this->attachValidator($eventName, $listener, $priority); } } diff --git a/src/ValidatorChain.php b/src/ValidatorChain.php index 50f24974..7e222819 100644 --- a/src/ValidatorChain.php +++ b/src/ValidatorChain.php @@ -30,9 +30,9 @@ public function __construct(protected StorageInterface $storage) * @param int $priority * @return callable */ - public function attach($eventName, callable $callback, $priority = 1) + public function attach($eventName, callable $listener, $priority = 1) { - return $this->attachValidator($eventName, $callback, $priority); + return $this->attachValidator($eventName, $listener, $priority); } /** diff --git a/test/TestAsset/Php81CompatibleStorageInterface.php b/test/TestAsset/Php81CompatibleStorageInterface.php index c3bb0895..510397bf 100644 --- a/test/TestAsset/Php81CompatibleStorageInterface.php +++ b/test/TestAsset/Php81CompatibleStorageInterface.php @@ -7,8 +7,8 @@ use Laminas\Session\Storage\StorageInterface; /** - * @template-covariant TKey of array-key - * @template-covariant TValue + * @template TKey of array-key + * @template TValue * @template-extends StorageInterface */ interface Php81CompatibleStorageInterface extends StorageInterface diff --git a/test/TestAsset/TestContainer.php b/test/TestAsset/TestContainer.php index ad14a2bf..9299390a 100644 --- a/test/TestAsset/TestContainer.php +++ b/test/TestAsset/TestContainer.php @@ -7,8 +7,8 @@ use Laminas\Session\AbstractContainer; /** - * @template-covariant TKey of string - * @template-covariant TValue + * @template TKey of string + * @template TValue * @template-extends AbstractContainer */ class TestContainer extends AbstractContainer From 7b3c5c496da0690fcc1bcfebd376c3b0ade225ef Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 05:56:25 +0100 Subject: [PATCH 08/12] Re-generating baseline based on latest `vimeo/psalm` upgrades --- psalm-baseline.xml | 249 ++++++++++++++++++++++++++++----------------- 1 file changed, 155 insertions(+), 94 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 7d3ad9f6..28eb2d21 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,14 +1,20 @@ - + null === $key null === $key null === static::$defaultManager + + Iterator + new static::$managerDefaultClass() + + Iterator + $container $this @@ -22,12 +28,14 @@ $value $value - + $metadata['EXPIRE_HOPS']['hops'] $metadata['EXPIRE_HOPS']['ts'] $metadata['EXPIRE_HOPS_KEYS'][$key] $metadata['EXPIRE_HOPS_KEYS'][$key] $metadata['EXPIRE_HOPS_KEYS'][$key]['hops'] + $metadata['EXPIRE_HOPS_KEYS'][$key]['hops'] + $metadata['EXPIRE_HOPS_KEYS'][$key]['ts'] $metadata['EXPIRE_HOPS_KEYS'][$key]['ts'] $metadata['EXPIRE_KEYS'][$key] $metadata['EXPIRE_KEYS'][$key] @@ -37,14 +45,17 @@ $storage[$name][$key] $storage[$name][$key] - + $metadata['EXPIRE_HOPS']['hops'] $metadata['EXPIRE_HOPS']['ts'] $metadata['EXPIRE_HOPS_KEYS'][$key] $metadata['EXPIRE_HOPS_KEYS'][$key] $metadata['EXPIRE_HOPS_KEYS'][$key] $metadata['EXPIRE_HOPS_KEYS'][$key] - $storage[$name][$key] + $metadata['EXPIRE_HOPS_KEYS'][$key]['hops'] + $metadata['EXPIRE_HOPS_KEYS'][$key]['hops'] + $metadata['EXPIRE_HOPS_KEYS'][$key]['ts'] + $metadata['EXPIRE_HOPS_KEYS'][$key]['ts'] $container @@ -58,24 +69,23 @@ $storage[$name][$key] - array - array + exchangeArray + getArrayCopy $metadata['EXPIRE_HOPS']['hops'] $metadata['EXPIRE_HOPS_KEYS'][$key]['hops'] $metadata['EXPIRE_HOPS_KEYS'][$key]['hops'] - + $container instanceof ArrayObject ? $container->getArrayCopy() : $container + $container instanceof ArrayObject ? $container->getArrayCopy() : $container + $old $old - - $key - $key - $key - $key - + + $old->getArrayCopy() + Container Container @@ -85,7 +95,8 @@ $input - + + $key $key $name $storage @@ -196,7 +207,8 @@ - + + ! is_array($options) && ! $options instanceof Traversable ! is_numeric($sidLength) is_numeric($cacheExpire) is_numeric($cookieLifetime) @@ -307,15 +319,22 @@ string string|null - + + $this->cookieDomain $this->cookieDomain $this->cookieHttpOnly + $this->cookieHttpOnly $this->cookieLifetime + $this->cookieLifetime + $this->cookiePath $this->cookiePath $this->cookieSameSite + $this->cookieSameSite + $this->cookieSecure $this->cookieSecure $this->getOption('hash_function') $this->name + $this->name $this->options['cache_expire'] $this->options['entropy_file'] $this->options['entropy_length'] @@ -326,13 +345,13 @@ $this->options['sid_bits_per_character'] $this->options['sid_length'] $this->rememberMeSeconds + $this->rememberMeSeconds + $this->savePath $this->savePath $this->useCookies + $this->useCookies - - (int) $sidLength - - + (bool) $cookieHttpOnly (bool) $cookieSecure (bool) $useCookies @@ -344,13 +363,13 @@ (int) $hashBitsPerCharacter (int) $rememberMeSeconds (int) $sidBitsPerCharacter + (int) $sidLength (string) $cookiePath (string) $cookieSameSite (string) $name - ConfigInterface StorageInterface @@ -362,18 +381,9 @@ $storage[$name][$key] - - $ret - - - $key - Container - - $ret - @@ -477,13 +487,16 @@ (string) $data - - $collection - $database - + + Binary + Binary + UTCDateTime + UTCDateTime + - + + $this->saveOptions === ['w' => 1] $this->saveOptions === ['w' => 1] @@ -536,7 +549,8 @@ null|ManagerInterface - + + $this->sessionManager $this->sessionManager @@ -632,6 +646,9 @@ $id + + $oldSessionData + $_SERVER['REQUEST_TIME'] @@ -645,42 +662,32 @@ (bool) $config->getCookieSecure() (bool) $deleteOldSession - + ! empty($oldSessionData) && is_array($oldSessionData) is_array($oldSessionData) - + $oldSessionData instanceof Traversable - + $_SESSION $this $this - $this - $this - $this - $this - $this - $this - $this - $this - $this + $values + $values + new ArrayIterator($_SESSION) - - ArrayStorage - ArrayStorage - ArrayStorage - ArrayStorage - ArrayStorage + SessionStorage SessionStorage array + array<TKey, TValue> + getIterator - + $_SESSION - $key $_SESSION['__Laminas'] @@ -717,21 +724,41 @@ $metaData - + + $key + + $_SESSION instanceof ArrayObject - - $locks - + is_object($input) - + + $flags + $iteratorClass + + + $key + $key + $key + '__Laminas' + '__Laminas' + '__Laminas' + '__Laminas' + '__Laminas' + '__Laminas' + '__Laminas' + '__Laminas' + '__Laminas' + '__Laminas' + '__Laminas' + '__Laminas' + + $key - - $key $key $key @@ -740,7 +767,12 @@ $locks $this['__Laminas'] $this['__Laminas'][$key] + $value + + $this['__Laminas'] + $this['__Laminas'] + $array[$key] $locks[$key] @@ -771,6 +803,15 @@ $metaData + + $key + + + $this['__Laminas'] + + + $this['__Laminas'][$key] + ArrayStorage @@ -812,6 +853,11 @@ + + '_IMMUTABLE' + '_IMMUTABLE' + '_IMMUTABLE' + SessionStorage @@ -836,7 +882,7 @@ CallbackHandler - $this->attachValidator($eventName, $callback, $priority) + $this->attachValidator($eventName, $listener, $priority) CallbackHandler @@ -849,9 +895,6 @@ new $validator($data) - - $callback - CallbackHandler @@ -885,9 +928,6 @@ new $validator($data) - - $callback - @@ -898,15 +938,9 @@ 'InvalidArgumentException' - + $handler $saveHandler - - - $handler - $saveHandler - - 'foobar_bogus' 'foobar_bogus' 'foobar_bogus' @@ -914,9 +948,15 @@ 'foobar_bogus' 'foobar_bogus' 'foobar_bogus' - 1 24 24 + + + $handler + $saveHandler + + + 1 static function (?string $module = null) { @@ -966,7 +1006,7 @@ setHashBitsPerCharacter setHashFunction - + 'foobar_bogus' 'foobar_bogus' 'foobar_bogus' @@ -977,7 +1017,7 @@ 'foobar_bogus' 24 24 - + testCookieSameSiteIsMutable @@ -1036,18 +1076,23 @@ $metadata['EXPIRE_HOPS_KEYS'] $metadata['EXPIRE_KEYS'] - + $metadata['EXPIRE'] $metadata['EXPIRE'] $metadata['EXPIRE_HOPS'] $metadata['EXPIRE_HOPS_KEYS'] $metadata['EXPIRE_HOPS_KEYS'] $metadata['EXPIRE_HOPS_KEYS'] + $metadata['EXPIRE_HOPS_KEYS']['foo'] $metadata['EXPIRE_KEYS'] $metadata['EXPIRE_KEYS'] $metadata['EXPIRE_KEYS'] $metadata['EXPIRE_KEYS'] $metadata['EXPIRE_KEYS'] + $metadata['EXPIRE_KEYS']['bat'] + $metadata['EXPIRE_KEYS']['baz'] + $metadata['EXPIRE_KEYS']['foo'] + $metadata['EXPIRE_KEYS']['foo'] $storage['Default']['foo'] $storage['foo']['baz'] $this->container['foo']['bar'] @@ -1113,8 +1158,7 @@ count - - $this->adapter + $this->adapter assertTrue is_string($data) @@ -1155,26 +1199,29 @@ count count - + 0 - - 123 123 123 456 456 456 - + + + RuntimeException::class + getenv('TESTS_LAMINAS_SESSION_ADAPTER_DRIVER_MONGODB_CONNECTION_STRING') - - $this->mongoCollection + $this->mongoCollection assertTrue is_string($data) + + RuntimeException + @@ -1265,8 +1312,9 @@ - + $config['session_storage']['options'] + $config['session_storage']['options']['input'] $storage @@ -1285,17 +1333,21 @@ $_SESSION $_SESSION - + $_SESSION['test']['foo'] $this->storage['foo']['bar'] $this->storage['foo']['bar'] $this->storage['foo']['bar'] + $this->storage['foo']['bar']['baz'] $_SESSION['foo']['bar'] $this->storage['bar'][] $this->storage['baz']['foo'] + + assertSame + @@ -1371,6 +1423,9 @@ $_SESSION->key1 $_SESSION->key2 + + $_SESSION + var_export($headers, 1) var_export($headers, 1) @@ -1433,10 +1488,16 @@ - + $this->storage['foo']['bar'] $this->storage['foo']['bar'] + $this->storage['foo']['bar']['baz'] + + $this->storage['foo']['bar'] + $this->storage['foo']['bar'] + $this->storage['foo']['bar']['baz'] + @@ -1460,10 +1521,10 @@ - + $id $id - + TestDbTableGatewaySaveHandler TestDbTableGatewaySaveHandler From 558dbba2169590bed8ea8e0fc9f4d0d3bd4f3b2d Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 06:00:54 +0100 Subject: [PATCH 09/12] Return `$this` from `ArrayStorage` for fluent interface methods --- src/Storage/ArrayStorage.php | 16 ++++++++-------- src/Storage/SessionStorage.php | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Storage/ArrayStorage.php b/src/Storage/ArrayStorage.php index 996e6038..e9f80cf8 100644 --- a/src/Storage/ArrayStorage.php +++ b/src/Storage/ArrayStorage.php @@ -60,7 +60,7 @@ public function __construct( * Set the request access time * * @param float $time - * @return ArrayStorage + * @return $this */ protected function setRequestAccessTime($time) { @@ -116,7 +116,7 @@ public function offsetSet($key, $value) * Lock this storage instance, or a key within it * * @param null|int|string $key - * @return ArrayStorage + * @return $this */ public function lock($key = null) { @@ -172,7 +172,7 @@ public function isLocked($key = null) * Unlock an object or key marked as locked * * @param null|int|string $key - * @return ArrayStorage + * @return $this */ public function unlock($key = null) { @@ -206,7 +206,7 @@ public function unlock($key = null) /** * Mark the storage container as isImmutable * - * @return ArrayStorage + * @return $this */ public function markImmutable() { @@ -238,7 +238,7 @@ public function isImmutable() * @param string $key * @param mixed $value * @param bool $overwriteArray Whether to overwrite or merge array values; by default, merges - * @return ArrayStorage + * @return $this * @throws Exception\RuntimeException */ public function setMetadata($key, $value, $overwriteArray = false) @@ -306,7 +306,7 @@ public function getMetadata($key = null) * Clear the storage object or a subkey of the object * * @param null|int|string $key - * @return ArrayStorage + * @return $this * @throws Exception\RuntimeException */ public function clear($key = null) @@ -340,7 +340,7 @@ public function clear($key = null) * Overwrites any data that was previously set. * * @param array $array - * @return ArrayStorage + * @return $this */ public function fromArray(array $array) { @@ -355,7 +355,7 @@ public function fromArray(array $array) * Cast the object to an array * * @param bool $metaData Whether to include metadata - * @return array + * @return array */ public function toArray($metaData = false) { diff --git a/src/Storage/SessionStorage.php b/src/Storage/SessionStorage.php index 5b4094b1..baa9fdf5 100644 --- a/src/Storage/SessionStorage.php +++ b/src/Storage/SessionStorage.php @@ -70,8 +70,8 @@ public function __destruct() * * Ensures $_SESSION is set to an instance of the object when complete. * - * @param array $array - * @return SessionStorage + * @param array $array + * @return $this */ public function fromArray(array $array) { @@ -86,7 +86,7 @@ public function fromArray(array $array) /** * Mark object as isImmutable * - * @return SessionStorage + * @return $this */ public function markImmutable() { From 5abfb7d29d525cf1f4899aacbab4d25b1976293b Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 22:13:27 +0100 Subject: [PATCH 10/12] Upgraded `laminas/laminas-stdlib` to get rid of mutable container changes removing type information Ref: https://github.com/laminas/laminas-stdlib/pull/78 Ref: 22dceb8540ca693e98f43e24b277b42bbdb2642d --- composer.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index 755fa6f2..fc36618f 100644 --- a/composer.lock +++ b/composer.lock @@ -166,16 +166,16 @@ }, { "name": "laminas/laminas-stdlib", - "version": "3.16.0", + "version": "3.16.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-stdlib.git", - "reference": "0880e3dd88eca01eeda9dfdb5a05c38e56902c2c" + "reference": "f4f773641807c7ccee59b758bfe4ac4ba33ecb17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/0880e3dd88eca01eeda9dfdb5a05c38e56902c2c", - "reference": "0880e3dd88eca01eeda9dfdb5a05c38e56902c2c", + "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/f4f773641807c7ccee59b758bfe4ac4ba33ecb17", + "reference": "f4f773641807c7ccee59b758bfe4ac4ba33ecb17", "shasum": "" }, "require": { @@ -221,7 +221,7 @@ "type": "community_bridge" } ], - "time": "2022-11-30T23:45:45+00:00" + "time": "2022-12-03T18:48:01+00:00" }, { "name": "psr/container", From 4307d48a7b7a393288832ccb6f8701cdfbc96dbd Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 22:17:29 +0100 Subject: [PATCH 11/12] Improved `AbstractContainer`'s `IteratorAggreate` type inference --- psalm-baseline.xml | 33 +++++---------------------------- src/AbstractContainer.php | 6 +----- 2 files changed, 6 insertions(+), 33 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 28eb2d21..2c5f28d4 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -6,15 +6,9 @@ null === $key null === static::$defaultManager - - Iterator - new static::$managerDefaultClass() - - Iterator - $container $this @@ -83,14 +77,15 @@ $old $old - + $old->getArrayCopy() + getIterator + new ArrayIterator($container) - + Container Container Container - Iterator $input @@ -1097,18 +1092,8 @@ $storage['foo']['baz'] $this->container['foo']['bar'] - - $test[$key] - $test[$key] - $test[$key] - $test[$key] - - + $hops - $key - $key - $key - $key $metadata $metadata $metadata @@ -1118,14 +1103,6 @@ $metadata $metadata $metadata - $test[$key] - $test[$key] - $test[$key] - $test[$key] - $value - $value - $value - $value $this->manager->started diff --git a/src/AbstractContainer.php b/src/AbstractContainer.php index 34c5b578..2ff31cc1 100644 --- a/src/AbstractContainer.php +++ b/src/AbstractContainer.php @@ -485,11 +485,7 @@ public function exchangeArray($input) return $old; } - /** - * Iterate over session container - * - * @return Iterator - */ + /** @inheritDoc */ public function getIterator() { $this->expireKeys(); From e1bada16cf9e269f6edd58684878df582698a2d5 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 22:22:14 +0100 Subject: [PATCH 12/12] Removed unused imports --- src/AbstractContainer.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/AbstractContainer.php b/src/AbstractContainer.php index 2ff31cc1..3fca8412 100644 --- a/src/AbstractContainer.php +++ b/src/AbstractContainer.php @@ -3,7 +3,6 @@ namespace Laminas\Session; use ArrayIterator; -use Iterator; use Laminas\Session\ManagerInterface as Manager; use Laminas\Session\Storage\StorageInterface as Storage; use Laminas\Stdlib\ArrayObject;