From 2dfbe7f6c73c51d6e08d932e88add50c399572b7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 2 Dec 2022 00:46:54 +0000 Subject: [PATCH 01/21] 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 4c0ab8b9..d7cc69d2 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,7 @@ "phpunit/phpunit": "^9.5.25", "psalm/plugin-phpunit": "^0.18.0", "psr/http-message": "^1.0.1", - "vimeo/psalm": "^4.29" + "vimeo/psalm": "^5.0" }, "conflict": { "laminas/laminas-servicemanager": "<3.3", diff --git a/composer.lock b/composer.lock index 8c07040b..89fa0624 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": "8ed681eef2cec06bd72db6d570ac6a0d", + "content-hash": "8269af9666b0e9e72310c1f339da24de", "packages": [ { "name": "laminas/laminas-escaper", @@ -4193,6 +4193,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", @@ -4826,24 +4889,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": "*", @@ -4852,35 +4915,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", @@ -4896,17 +4958,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/" } @@ -4928,9 +4987,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", @@ -5044,57 +5103,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 af5d23bb6902a41179fe40c4849e6e9bb951d526 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 2 Dec 2022 00:47:14 +0000 Subject: [PATCH 02/21] Lock file maintenance Signed-off-by: Renovate Bot --- composer.lock | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/composer.lock b/composer.lock index 8c07040b..41ec7a11 100644 --- a/composer.lock +++ b/composer.lock @@ -70,16 +70,16 @@ }, { "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": { @@ -102,14 +102,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" @@ -156,7 +156,7 @@ "type": "community_bridge" } ], - "time": "2022-10-10T20:59:22+00:00" + "time": "2022-12-01T17:03:38+00:00" }, { "name": "laminas/laminas-stdlib", @@ -1303,16 +1303,16 @@ }, { "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": { @@ -1325,11 +1325,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", @@ -1367,7 +1367,7 @@ "type": "community_bridge" } ], - "time": "2022-10-11T12:46:13+00:00" + "time": "2022-12-01T16:12:47+00:00" }, { "name": "laminas/laminas-http", From dfa0b08f2c22a40f2b7c1a3b171b392fb7a3fb4c Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 01:34:38 +0100 Subject: [PATCH 03/21] Upgrade dependencies to `vimeo/psalm:5.1.0` --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index d7cc69d2..556586ca 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,7 @@ "phpunit/phpunit": "^9.5.25", "psalm/plugin-phpunit": "^0.18.0", "psr/http-message": "^1.0.1", - "vimeo/psalm": "^5.0" + "vimeo/psalm": "^5.1.0" }, "conflict": { "laminas/laminas-servicemanager": "<3.3", diff --git a/composer.lock b/composer.lock index e2894af1..eeb2f6e8 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": "8269af9666b0e9e72310c1f339da24de", + "content-hash": "7e1e085dfd8025186518e4e76cb933c1", "packages": [ { "name": "laminas/laminas-escaper", @@ -4889,16 +4889,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": { @@ -4987,9 +4987,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 4a82dcdb0a3010852b107b32fd39d86c763827b2 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 01:36:09 +0100 Subject: [PATCH 04/21] More precise return types for elements that produce `$this` or `static` --- src/Reader/ReaderImportInterface.php | 2 +- src/Uri.php | 2 +- src/Writer/AbstractFeed.php | 6 +++--- src/Writer/Extension/GooglePlayPodcast/Feed.php | 2 +- src/Writer/Extension/ITunes/Feed.php | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Reader/ReaderImportInterface.php b/src/Reader/ReaderImportInterface.php index c7bb1bca..3c8a1d5b 100644 --- a/src/Reader/ReaderImportInterface.php +++ b/src/Reader/ReaderImportInterface.php @@ -27,7 +27,7 @@ public static function import($uri, $etag = null, $lastModified = null); * HTTP client implementations. * * @param string $uri - * @return self + * @return static * @throws Exception\RuntimeException If response is not an Http\ResponseInterface. */ public static function importRemoteFeed($uri, Http\ClientInterface $client); diff --git a/src/Uri.php b/src/Uri.php index a522acf5..956fb03f 100644 --- a/src/Uri.php +++ b/src/Uri.php @@ -75,7 +75,7 @@ public function __construct($uri) * Useful for chained validations * * @param string $uri - * @return self + * @return static */ public static function factory($uri) { diff --git a/src/Writer/AbstractFeed.php b/src/Writer/AbstractFeed.php index 5e5ec5fd..47a32d8b 100644 --- a/src/Writer/AbstractFeed.php +++ b/src/Writer/AbstractFeed.php @@ -138,7 +138,7 @@ public function setCopyright($copyright) * Set the feed creation date * * @param DateTime|DateTimeImmutable|int|null|string $date - * @return self + * @return $this * @throws Exception\InvalidArgumentException */ public function setDateCreated($date = null) @@ -163,7 +163,7 @@ public function setDateCreated($date = null) * Set the feed modification date * * @param DateTime|DateTimeImmutable|int|null|string $date - * @return self + * @return $this * @throws Exception\InvalidArgumentException */ public function setDateModified($date = null) @@ -188,7 +188,7 @@ public function setDateModified($date = null) * Set the feed last-build date. Ignored for Atom 1.0. * * @param DateTime|DateTimeImmutable|int|null|string $date - * @return self + * @return $this * @throws Exception\InvalidArgumentException */ public function setLastBuildDate($date = null) diff --git a/src/Writer/Extension/GooglePlayPodcast/Feed.php b/src/Writer/Extension/GooglePlayPodcast/Feed.php index c4e330df..bc275cbf 100644 --- a/src/Writer/Extension/GooglePlayPodcast/Feed.php +++ b/src/Writer/Extension/GooglePlayPodcast/Feed.php @@ -75,7 +75,7 @@ public function getEncoding() * Set a block value of "yes" or "no". You may also set an empty string. * * @param string $value - * @return self + * @return $this * @throws Writer\Exception\InvalidArgumentException */ public function setPlayPodcastBlock($value) diff --git a/src/Writer/Extension/ITunes/Feed.php b/src/Writer/Extension/ITunes/Feed.php index 0bb48de0..cbf98a3b 100644 --- a/src/Writer/Extension/ITunes/Feed.php +++ b/src/Writer/Extension/ITunes/Feed.php @@ -86,7 +86,7 @@ public function getEncoding() * Set a block value of "yes" or "no". You may also set an empty string. * * @param string $value - * @return self + * @return $this * @throws Writer\Exception\InvalidArgumentException */ public function setItunesBlock($value) From 0602129f50c16df5d5436289a57adb27450263c1 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 01:52:53 +0100 Subject: [PATCH 05/21] Exceptions should always be `Throwable`: marking this component's `ExceptionInterface` as such --- src/Exception/ExceptionInterface.php | 4 +++- src/Writer/Exception/ExceptionInterface.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Exception/ExceptionInterface.php b/src/Exception/ExceptionInterface.php index 144f9903..b3ac261a 100644 --- a/src/Exception/ExceptionInterface.php +++ b/src/Exception/ExceptionInterface.php @@ -4,6 +4,8 @@ namespace Laminas\Feed\Exception; -interface ExceptionInterface +use Throwable; + +interface ExceptionInterface extends Throwable { } diff --git a/src/Writer/Exception/ExceptionInterface.php b/src/Writer/Exception/ExceptionInterface.php index 3105e748..6e0e540a 100644 --- a/src/Writer/Exception/ExceptionInterface.php +++ b/src/Writer/Exception/ExceptionInterface.php @@ -4,11 +4,13 @@ namespace Laminas\Feed\Writer\Exception; +use Throwable; + /** * Feed exceptions * * Interface to represent exceptions that occur during Feed operations. */ -interface ExceptionInterface +interface ExceptionInterface extends Throwable { } From 9ef0146a6e546b2322f0a8baff59e740a74d4a20 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 01:56:35 +0100 Subject: [PATCH 06/21] Better data provider return type documentation --- test/Writer/Extension/ITunes/EntryTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Writer/Extension/ITunes/EntryTest.php b/test/Writer/Extension/ITunes/EntryTest.php index b0b55b48..8c026f12 100644 --- a/test/Writer/Extension/ITunes/EntryTest.php +++ b/test/Writer/Extension/ITunes/EntryTest.php @@ -256,7 +256,7 @@ public function testSetSummaryThrowsExceptionWhenValueExceeds255Chars(): void $entry->setItunesSummary(str_repeat('a', 4001)); } - /** @psalm-return array */ + /** @psalm-return array */ public function invalidImageUrls(): array { return [ From a4ae836b4badb90b97f6bc7f835be5b14790f78a Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 01:56:59 +0100 Subject: [PATCH 07/21] Adjusted return type for PHP error handler used in tests --- test/Writer/EntryTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/Writer/EntryTest.php b/test/Writer/EntryTest.php index 25d20a1f..7750ea74 100644 --- a/test/Writer/EntryTest.php +++ b/test/Writer/EntryTest.php @@ -767,9 +767,10 @@ public function testEntryWriterEmitsNoticeDuringFeedImportWhenGooglePlayPodcastE 'messages' => [], ]; - /** @psalm-suppress UnusedClosureParam */ - set_error_handler(static function (int $errno, string $errstr) use ($notices): void { + set_error_handler(static function (int $_errno, string $errstr) use ($notices): ?bool { $notices->messages[] = $errstr; + + return null; }, E_USER_NOTICE); new Writer\Entry(); restore_error_handler(); From babd57d8dbf228901ddbadf01632c8bc1f287696 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 01:57:14 +0100 Subject: [PATCH 08/21] More precise return type declaration for fluent API --- src/Writer/Deleted.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Writer/Deleted.php b/src/Writer/Deleted.php index e1ac3f2a..1b51e3f4 100644 --- a/src/Writer/Deleted.php +++ b/src/Writer/Deleted.php @@ -33,7 +33,7 @@ class Deleted * Set the feed character encoding * * @param null|string $encoding - * @return static + * @return $this * @throws Exception\InvalidArgumentException */ public function setEncoding($encoding) From 2a3be0c022682c553a3d458b4308974a4b1e5e6d Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 02:05:27 +0100 Subject: [PATCH 09/21] Corrected `ReaderImportInterface#importRemoteFeed()` type --- src/Reader/ReaderImportInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Reader/ReaderImportInterface.php b/src/Reader/ReaderImportInterface.php index 3c8a1d5b..2a48e2b3 100644 --- a/src/Reader/ReaderImportInterface.php +++ b/src/Reader/ReaderImportInterface.php @@ -27,7 +27,7 @@ public static function import($uri, $etag = null, $lastModified = null); * HTTP client implementations. * * @param string $uri - * @return static + * @return Feed\FeedInterface * @throws Exception\RuntimeException If response is not an Http\ResponseInterface. */ public static function importRemoteFeed($uri, Http\ClientInterface $client); From a24ded510bae68cd5e692f318b1480d19bb7e7b1 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 03:08:08 +0100 Subject: [PATCH 10/21] Adding missing template parameters to `ExtensionPluginManager` --- src/Reader/ExtensionPluginManager.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/Reader/ExtensionPluginManager.php b/src/Reader/ExtensionPluginManager.php index 56bd0f1f..3522f876 100644 --- a/src/Reader/ExtensionPluginManager.php +++ b/src/Reader/ExtensionPluginManager.php @@ -25,6 +25,9 @@ * @psalm-import-type FactoriesConfigurationType from ConfigInterface * @final this class wasn't designed to be inherited from, but we can't assume that consumers haven't already * extended it, therefore we cannot add the final marker without a new major release. + * + * @template InstanceType of AbstractEntry|AbstractFeed + * @template-extends AbstractPluginManager */ class ExtensionPluginManager extends AbstractPluginManager implements ExtensionManagerInterface { @@ -200,15 +203,7 @@ class ExtensionPluginManager extends AbstractPluginManager implements ExtensionM */ protected $sharedByDefault = false; - /** - * Validate the plugin - * - * Checks that the extension loaded is of a valid type. - * - * @param mixed $instance - * @return void - * @throws Exception\InvalidArgumentException If invalid. - */ + /** @inheritDoc */ public function validate($instance) { if ( From 3d899e955c30b4c303a9e4aeff176d2552148867 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 03:09:10 +0100 Subject: [PATCH 11/21] Stubbing `DOMXPath#query()` for Psalm This project assumes that `DOMXPath#query()` is always containing valid XPath query strings (we test them), and that a `DOMNodeList` is always produced. Also, removing some junk from the generated distribution package :) --- .domxpath.php.stub | 11 +++++++++++ .gitattributes | 4 ++++ psalm.xml | 5 +++++ 3 files changed, 20 insertions(+) create mode 100644 .domxpath.php.stub diff --git a/.domxpath.php.stub b/.domxpath.php.stub new file mode 100644 index 00000000..c2df9293 --- /dev/null +++ b/.domxpath.php.stub @@ -0,0 +1,11 @@ + + + + + @@ -27,6 +31,7 @@ + From 29cc582575207bcf956f5faf985cefd2f2b8264f Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 03:19:19 +0100 Subject: [PATCH 12/21] Improving `FeedSet` internal types --- src/Reader/FeedSet.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Reader/FeedSet.php b/src/Reader/FeedSet.php index 2ded6c71..eff1ffeb 100644 --- a/src/Reader/FeedSet.php +++ b/src/Reader/FeedSet.php @@ -20,6 +20,7 @@ use function strtolower; use function trim; +/** @template-extends ArrayObject */ class FeedSet extends ArrayObject { /** @var null|string */ @@ -165,11 +166,10 @@ protected function canonicalizePath($path) } /** + * @inheritDoc + * * Supports lazy loading of feeds using Reader::import() but * delegates any other operations to the parent class. - * - * @param string $offset - * @return mixed */ #[ReturnTypeWillChange] public function offsetGet($offset) From a27f2d0ab4477b1d6b68f5c51b3545b50ca34b0d Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 03:26:38 +0100 Subject: [PATCH 13/21] Documenting `Feed` iterable API types --- src/Writer/Feed.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Writer/Feed.php b/src/Writer/Feed.php index 42ffa4c8..2b2f6ca1 100644 --- a/src/Writer/Feed.php +++ b/src/Writer/Feed.php @@ -18,12 +18,13 @@ use const SORT_NUMERIC; +/** @template-implements Iterator */ class Feed extends AbstractFeed implements Iterator, Countable { /** * Contains all entry objects * - * @var array + * @var array */ protected $entries = []; @@ -160,7 +161,7 @@ public function orderByDate() * Get the number of feed entries. * Required by the Iterator interface. * - * @return int + * @return positive-int|0 */ #[ReturnTypeWillChange] public function count() From 97756b86f914b2f7d191f7a1f76fe773ccb2c158 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 03:34:54 +0100 Subject: [PATCH 14/21] Documenting `ExtensionPluginManager` possible plugin types --- src/Writer/ExtensionPluginManager.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/Writer/ExtensionPluginManager.php b/src/Writer/ExtensionPluginManager.php index 9cb0a614..7206e305 100644 --- a/src/Writer/ExtensionPluginManager.php +++ b/src/Writer/ExtensionPluginManager.php @@ -14,12 +14,17 @@ use function sprintf; use function substr; +// phpcs:disable Generic.Files.LineLength.TooLong /** * Plugin manager implementation for feed writer extensions * * Validation checks that we have an Entry, Feed, or Extension\AbstractRenderer. * * @psalm-import-type FactoriesConfigurationType from ConfigInterface + * + * @template InstanceType of Extension\AbstractRenderer|\Laminas\Feed\Writer\Extension\GooglePlayPodcast\Entry|\Laminas\Feed\Writer\Extension\GooglePlayPodcast\Feed|\Laminas\Feed\Writer\Extension\ITunes\Entry|\Laminas\Feed\Writer\Extension\ITunes\Feed|\Laminas\Feed\Writer\Extension\PodcastIndex\Entry|\Laminas\Feed\Writer\Extension\PodcastIndex\Feed + * + * @template-extends AbstractPluginManager */ class ExtensionPluginManager extends AbstractPluginManager implements ExtensionManagerInterface { @@ -231,16 +236,8 @@ class ExtensionPluginManager extends AbstractPluginManager implements ExtensionM */ protected $sharedByDefault = false; - /** - * Validate the plugin (v3) - * - * Checks that the extension loaded is of a valid type. - * - * @param mixed $instance - * @return void - * @throws InvalidServiceException If invalid. - */ - public function validate($instance) + /** @inheritDoc */ + public function validate(mixed $instance) { if ($instance instanceof Extension\AbstractRenderer) { // we're okay From b1e5210cc67a05fb0f66c13d79a6a658fc62f9d0 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 03:38:32 +0100 Subject: [PATCH 15/21] Documenting `ExtensionPluginManager#validate()` input type --- src/Reader/ExtensionPluginManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Reader/ExtensionPluginManager.php b/src/Reader/ExtensionPluginManager.php index 3522f876..4a2e5c9e 100644 --- a/src/Reader/ExtensionPluginManager.php +++ b/src/Reader/ExtensionPluginManager.php @@ -204,7 +204,7 @@ class ExtensionPluginManager extends AbstractPluginManager implements ExtensionM protected $sharedByDefault = false; /** @inheritDoc */ - public function validate($instance) + public function validate(mixed $instance) { if ( $instance instanceof AbstractEntry From 870ae00e1495949d3f41d76dab3d460a5518aaaf Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 03:54:30 +0100 Subject: [PATCH 16/21] Documenting generic types of collection objects --- src/Reader/Collection/AbstractCollection.php | 7 ++++++- src/Reader/Collection/Author.php | 5 +++-- src/Reader/Collection/Category.php | 5 +++-- src/Reader/Collection/Collection.php | 5 +++++ 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/Reader/Collection/AbstractCollection.php b/src/Reader/Collection/AbstractCollection.php index 58cee3cc..741417b9 100644 --- a/src/Reader/Collection/AbstractCollection.php +++ b/src/Reader/Collection/AbstractCollection.php @@ -6,6 +6,11 @@ use ArrayObject; +/** + * @template TKey + * @template TValue + * @template-extends ArrayObject + */ abstract class AbstractCollection extends ArrayObject { /** @@ -14,7 +19,7 @@ abstract class AbstractCollection extends ArrayObject * the category name, domain/URI, and other data. This method would * merely return the most useful data - i.e. the category names. * - * @return array + * @return array */ abstract public function getValues(); } diff --git a/src/Reader/Collection/Author.php b/src/Reader/Collection/Author.php index fbfd22ce..80d7453c 100644 --- a/src/Reader/Collection/Author.php +++ b/src/Reader/Collection/Author.php @@ -6,13 +6,14 @@ use function array_unique; +/** @template-extends AbstractCollection */ class Author extends AbstractCollection { /** + * @inheritDoc + * * Return a simple array of the most relevant slice of * the author values, i.e. all author names. - * - * @return array */ public function getValues() { diff --git a/src/Reader/Collection/Category.php b/src/Reader/Collection/Category.php index 9d65a0c0..e037ac9a 100644 --- a/src/Reader/Collection/Category.php +++ b/src/Reader/Collection/Category.php @@ -6,15 +6,16 @@ use function array_unique; +/** @template-extends AbstractCollection */ class Category extends AbstractCollection { /** + * @inheritDoc + * * Return a simple array of the most relevant slice of * the collection values. For example, feed categories contain * the category name, domain/URI, and other data. This method would * merely return the most useful data - i.e. the category names. - * - * @return array */ public function getValues() { diff --git a/src/Reader/Collection/Collection.php b/src/Reader/Collection/Collection.php index b0baaae8..53979dfa 100644 --- a/src/Reader/Collection/Collection.php +++ b/src/Reader/Collection/Collection.php @@ -6,6 +6,11 @@ use ArrayObject; +/** + * @template TKey + * @template TValue + * @template-extends ArrayObject + */ class Collection extends ArrayObject { } From c94ed85c41508b28efbe0828819037ba99a20ea5 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 04:03:53 +0100 Subject: [PATCH 17/21] Documenting `Reader#arrayUnique()` type preservation properties --- src/Reader/Reader.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Reader/Reader.php b/src/Reader/Reader.php index f38bce72..81de1151 100644 --- a/src/Reader/Reader.php +++ b/src/Reader/Reader.php @@ -753,8 +753,12 @@ protected static function registerCoreExtensions() /** * Utility method to apply array_unique operation to a multidimensional * array. + * + * @template TInput of array * - * @return array + * @param TInput $array + * + * @return TInput */ public static function arrayUnique(array $array) { From 0d07377bab9e1aba8f22286684b2bdcb0ef263bc Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 04:12:39 +0100 Subject: [PATCH 18/21] Generic types for feed abstractions and items thereof --- src/Reader/AbstractFeed.php | 5 ++++- src/Reader/Collection.php | 4 ++++ src/Reader/Feed/AbstractFeed.php | 5 +++++ src/Reader/Feed/Atom.php | 1 + src/Reader/Feed/FeedInterface.php | 5 +++++ src/Reader/Feed/Rss.php | 1 + src/Writer/Feed.php | 2 +- 7 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/Reader/AbstractFeed.php b/src/Reader/AbstractFeed.php index 2c28711f..8eabed03 100644 --- a/src/Reader/AbstractFeed.php +++ b/src/Reader/AbstractFeed.php @@ -17,7 +17,10 @@ use function strpos; /** - * @deprecated This (abstract) class is deprecated. Use \Laminas\Feed\Reader\Feed\AbstractFeed instead. + * @deprecated This (abstract) class is deprecated. Use \Laminas\Feed\Reader\Feed\AbstractFeed instead.] + * + * @template TItem of Entry\AbstractEntry + * @template-implements Feed\FeedInterface */ abstract class AbstractFeed implements Feed\FeedInterface { diff --git a/src/Reader/Collection.php b/src/Reader/Collection.php index aa7dcbaa..d21aa302 100644 --- a/src/Reader/Collection.php +++ b/src/Reader/Collection.php @@ -10,6 +10,10 @@ * @deprecated This class is deprecated. Use the concrete collection classes * \Laminas\Feed\Reader\Collection\Author and \Laminas\Feed\Reader\Collection\Category * or the generic class \Laminas\Feed\Reader\Collection\Collection instead. + * + * @template TKey + * @template TValue + * @template-extends ArrayObject */ class Collection extends ArrayObject { diff --git a/src/Reader/Feed/AbstractFeed.php b/src/Reader/Feed/AbstractFeed.php index 6f2c32f0..659b0221 100644 --- a/src/Reader/Feed/AbstractFeed.php +++ b/src/Reader/Feed/AbstractFeed.php @@ -8,6 +8,7 @@ use DOMElement; use DOMXPath; use Laminas\Feed\Reader; +use Laminas\Feed\Reader\Entry\EntryInterface; use Laminas\Feed\Reader\Exception; // phpcs:ignore SlevomatCodingStandard.Namespaces.UnusedUses.UnusedUse use ReturnTypeWillChange; @@ -20,6 +21,10 @@ use function sprintf; use function strpos; +/** + * @template TItem of Reader\Entry\Rss|Reader\Entry\Atom + * @template-implements FeedInterface + */ abstract class AbstractFeed implements FeedInterface { /** diff --git a/src/Reader/Feed/Atom.php b/src/Reader/Feed/Atom.php index e162741a..10d50359 100644 --- a/src/Reader/Feed/Atom.php +++ b/src/Reader/Feed/Atom.php @@ -12,6 +12,7 @@ use function count; use function is_array; +/** @template-extends AbstractFeed */ class Atom extends AbstractFeed { /** diff --git a/src/Reader/Feed/FeedInterface.php b/src/Reader/Feed/FeedInterface.php index 1ad1c5a8..e048de3a 100644 --- a/src/Reader/Feed/FeedInterface.php +++ b/src/Reader/Feed/FeedInterface.php @@ -8,7 +8,12 @@ use DateTime; use Iterator; use Laminas\Feed\Reader\Collection\Category; +use Laminas\Feed\Reader\Entry\EntryInterface; +/** + * @template TItem of EntryInterface + * @template-extends Iterator + */ interface FeedInterface extends Iterator, Countable { /** diff --git a/src/Reader/Feed/Rss.php b/src/Reader/Feed/Rss.php index eb3f06bf..dbb496ae 100644 --- a/src/Reader/Feed/Rss.php +++ b/src/Reader/Feed/Rss.php @@ -18,6 +18,7 @@ use function strtotime; use function trim; +/** @template-extends AbstractFeed */ class Rss extends AbstractFeed { /** diff --git a/src/Writer/Feed.php b/src/Writer/Feed.php index 2b2f6ca1..8d1d4308 100644 --- a/src/Writer/Feed.php +++ b/src/Writer/Feed.php @@ -183,7 +183,7 @@ public function current() /** * Return the current feed key * - * @return mixed + * @return int */ #[ReturnTypeWillChange] public function key() From 765108da288cb17f215b327a5a07b2838f4c2535 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 04:15:00 +0100 Subject: [PATCH 19/21] Re-enabled all psalm checks, re-generated baseline --- psalm-baseline.xml | 1820 ++++++++++---------------------------------- psalm.xml | 14 - 2 files changed, 414 insertions(+), 1420 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 88062856..3d7fc0e4 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + $this->httpResponse === null @@ -41,9 +41,9 @@ ! is_int($code) - + strlen($content) - + $header['replace'] $header['replace'] @@ -88,9 +88,7 @@ - - ! is_string($key) - ! is_string($key) + null === $this->now @@ -118,6 +116,10 @@ $now + + ! is_string($key) + ! is_string($key) + @@ -129,24 +131,15 @@ $feed->getHubs() + + getHubs + $source instanceof Reader\Feed\AbstractFeed - - getHubs - - - ! is_string($name) - ! is_string($name) - ! is_string($url) - ! is_string($url) - ! is_string($url) - ! is_string($value) - empty($url) || ! is_string($url) - empty($url) || ! is_string($url) - empty($url) || ! is_string($url) + is_array($options) @@ -175,21 +168,24 @@ $response->getContent() - - - + + ! is_string($value) && $value !== null + + ! is_string($name) ! is_string($name) ! is_string($url) ! is_string($url) ! is_string($url) - ! is_string($url) ! is_string($value) - $this->storage === null - empty($url) || ! is_string($url) empty($url) || ! is_string($url) empty($url) || ! is_string($url) empty($url) || ! is_string($url) + + + + + $this->storage === null is_array($options) @@ -262,17 +258,33 @@ (string) $token + + ! is_string($value) && $value !== null + $this->getLeaseSeconds() !== null + + ! is_string($name) + ! is_string($name) + ! is_string($url) + ! is_string($url) + ! is_string($url) + ! is_string($url) + ! is_string($value) + empty($url) || ! is_string($url) + empty($url) || ! is_string($url) + empty($url) || ! is_string($url) + empty($url) || ! is_string($url) + $this->feedUpdate === null - + $this->getSubscriberCount() - + $httpGetData['hub_challenge'] $httpGetData['hub_mode'] @@ -374,9 +386,15 @@ - + + Entry\AbstractEntry + + $this->key() - + + + Feed\FeedInterface + indexEntries loadExtensions @@ -412,25 +430,9 @@ $originalSourceUri - - - - $element['name'] - - - $authors[] - $element - - - - - $element['term'] - - - $categories[] - $categories[] - $element - + + Feed\FeedInterface + @@ -504,7 +506,7 @@ setType setXpath - + $this->data['authors'] $this->data['categories'] $this->data['commentcount'] @@ -531,20 +533,23 @@ + + Reader\Reader::arrayUnique($authors) + null|string null|string void + + $entryKey + string $this->data['authors'] - - $entryKey - $dateModified $dateModified @@ -583,25 +588,30 @@ setType setXpath - + $this->data['authors'] $this->data['categories'] $this->data['commentcount'] $this->data['commentfeedlink'] $this->data['commentlink'] $this->data['commentlink'] + $this->data['commentlink'] $this->data['content'] $this->data['datemodified'] $this->data['description'] $this->data['enclosure'] $this->data['id'] $this->data['id'] + $this->data['id'] $this->data['links'] $this->data['title'] null|array<string, string> + + $categoryCollection + $this->data['commentfeedlink'] $this->data['commentlink'] @@ -616,6 +626,12 @@ Rss + + $list instanceof DOMNodeList + $list instanceof DOMNodeList + $list instanceof DOMNodeList + $nodeList instanceof DOMNodeList + getAttribute @@ -629,6 +645,9 @@ $this->getEntryElement() + + string + $entryKey @@ -673,9 +692,13 @@ string - + + $type $type + + $this->getDomDocument()->encoding + $entry->ownerDocument @@ -689,6 +712,9 @@ null === $this->xpath + + string + $domDocument $domDocument @@ -716,17 +742,22 @@ string - + + $type $type + + $this->getDomDocument()->encoding + null - + $author $element + Reader\Reader::arrayUnique($authors) $content ?? '' @@ -769,13 +800,15 @@ string string - + $this->data['authors'] $this->data['baseUrl'] $this->data['baseUrl'] + $this->data['baseUrl'] $this->data['categories'] $this->data['commentcount'] $this->data['commentcount'] + $this->data['commentcount'] $this->data['commentfeedlink'] $this->data['commentlink'] $this->data['content'] @@ -783,13 +816,18 @@ $this->data['datemodified'] $this->data['description'] $this->data['description'] + $this->data['description'] $this->data['enclosure'] $this->data['id'] $this->data['id'] + $this->data['id'] $this->data['links'] $this->data['source'] $this->data['title'] + + $categoryCollection + $this->data['commentfeedlink'] $this->data['commentlink'] @@ -797,9 +835,25 @@ $this->data['id'] $this->data['title'] + + $d->lookupPrefix('http://www.w3.org/1999/xhtml') + $this->getBaseUrl() + + $list instanceof DOMNodeList + $list instanceof DOMNodeList + $list instanceof DOMNodeList + $list instanceof DOMNodeList + $list instanceof DOMNodeList + $list instanceof DOMNodeList + $list instanceof DOMNodeList + $nodeList instanceof DOMNodeList + + + ! $list instanceof DOMNodeList + getAttribute getAttribute @@ -814,8 +868,9 @@ - + $author + Reader\Reader::arrayUnique($authors) $dateCreated @@ -855,10 +910,11 @@ null|string null|string - + $this->data['authors'] $this->data['baseUrl'] $this->data['baseUrl'] + $this->data['baseUrl'] $this->data['categories'] $this->data['copyright'] $this->data['datecreated'] @@ -867,16 +923,23 @@ $this->data['feedlink'] $this->data['generator'] $this->data['generator'] + $this->data['generator'] $this->data['hubs'] $this->data['id'] $this->data['id'] + $this->data['id'] $this->data['image'] $this->data['language'] $this->data['language'] + $this->data['language'] $this->data['link'] $this->data['title'] $this->data['title'] + $this->data['title'] + + $categoryCollection + $uri->nodeValue @@ -927,6 +990,9 @@ + + Reader\Reader::arrayUnique($authors) + $this->data['authors'] @@ -957,20 +1023,25 @@ string string - + $this->data['authors'] $this->data['categories'] $this->data['date'] $this->data['description'] $this->data['description'] + $this->data['description'] $this->data['id'] $this->data['id'] $this->data['title'] $this->data['title'] + $this->data['title'] null|array<string, string> + + $categoryCollection + $this->data['authors'] $this->data['description'] @@ -978,6 +1049,9 @@ + + Reader\Reader::arrayUnique($authors) + $this->data['authors'] @@ -1010,21 +1084,28 @@ null|string null|string - + $this->data['authors'] $this->data['categories'] $this->data['copyright'] $this->data['copyright'] + $this->data['copyright'] $this->data['date'] $this->data['description'] $this->data['description'] + $this->data['description'] $this->data['id'] $this->data['id'] $this->data['language'] $this->data['language'] + $this->data['language'] + $this->data['title'] $this->data['title'] $this->data['title'] + + $categoryCollection + $this->data['authors'] @@ -1040,11 +1121,14 @@ string string - + + $this->data['block'] $this->data['block'] $this->data['block'] $this->data['description'] $this->data['description'] + $this->data['description'] + $this->data['explicit'] $this->data['explicit'] $this->data['explicit'] @@ -1070,18 +1154,23 @@ string string - + $this->data['author'] $this->data['author'] + $this->data['author'] + $this->data['block'] $this->data['block'] $this->data['block'] $this->data['categories'] $this->data['description'] $this->data['description'] + $this->data['description'] + $this->data['explicit'] $this->data['explicit'] $this->data['explicit'] $this->data['image'] $this->data['image'] + $this->data['image'] $this->data['author'] @@ -1126,27 +1215,36 @@ string string - + + $this->data['author'] $this->data['author'] $this->data['author'] $this->data['block'] $this->data['block'] + $this->data['block'] + $this->data['duration'] $this->data['duration'] $this->data['duration'] $this->data['episode'] $this->data['episodeType'] $this->data['explicit'] $this->data['explicit'] + $this->data['explicit'] + $this->data['image'] $this->data['image'] $this->data['image'] $this->data['isClosedCaptioned'] $this->data['keywords'] $this->data['keywords'] + $this->data['keywords'] $this->data['season'] $this->data['subtitle'] $this->data['subtitle'] + $this->data['subtitle'] $this->data['summary'] $this->data['summary'] + $this->data['summary'] + $this->data['title'] $this->data['title'] $this->data['title'] @@ -1196,26 +1294,35 @@ $email $name - + + $this->data['author'] $this->data['author'] $this->data['author'] $this->data['block'] $this->data['block'] + $this->data['block'] $this->data['categories'] $this->data['complete'] $this->data['explicit'] $this->data['explicit'] + $this->data['explicit'] $this->data['image'] $this->data['image'] + $this->data['image'] + $this->data['keywords'] $this->data['keywords'] $this->data['keywords'] $this->data['new-feed-url'] $this->data['new-feed-url'] + $this->data['new-feed-url'] + $this->data['owner'] $this->data['owner'] $this->data['owner'] $this->data['podcastType'] $this->data['subtitle'] $this->data['subtitle'] + $this->data['subtitle'] + $this->data['summary'] $this->data['summary'] $this->data['summary'] @@ -1262,10 +1369,11 @@ bool null|object{url: string, title: string} - + $this->data['locked'] $this->data['owner'] $this->data['owner'] + $this->data['owner'] @@ -1286,11 +1394,13 @@ null|string null|string - + $comments $this->data[$name] $this->data[$name] $this->getData('department') + $this->getData('department') + $this->getData('section') $this->getData('section') @@ -1329,7 +1439,8 @@ null|int - + + $this->getData('total') $this->getData('total') @@ -1340,7 +1451,8 @@ null|string - + + $data $data $this->data[$name] @@ -1352,7 +1464,8 @@ Extension\AbstractEntry|Extension\AbstractFeed - + + $this->pluginManager->get($extension) $this->pluginManager->get($extension) @@ -1362,9 +1475,12 @@ - + $this->key() - + + + Reader\Entry\EntryInterface + indexEntries loadExtensions @@ -1466,7 +1582,7 @@ setXpath setXpathPrefix - + $this->data['authors'] $this->data['authors'] $this->data['baseUrl'] @@ -1475,12 +1591,17 @@ $this->data['categories'] $this->data['copyright'] $this->data['copyright'] + $this->data['copyright'] $this->data['datecreated'] $this->data['datecreated'] + $this->data['datecreated'] + $this->data['datemodified'] $this->data['datemodified'] $this->data['datemodified'] $this->data['description'] $this->data['description'] + $this->data['description'] + $this->data['feedlink'] $this->data['feedlink'] $this->data['feedlink'] $this->data['generator'] @@ -1493,6 +1614,7 @@ $this->data['image'] $this->data['language'] $this->data['language'] + $this->data['language'] $this->data['link'] $this->data['link'] $this->data['title'] @@ -1542,7 +1664,9 @@ - + + void + void void void void @@ -1569,6 +1693,9 @@ + + Reader\Reader::arrayUnique($authors) + null|array<string, string> @@ -1672,36 +1799,50 @@ setXpath setXpathPrefix - + $this->data['authors'] $this->data['authors'] + $this->data['authors'] + $this->data['categories'] $this->data['categories'] $this->data['categories'] $this->data['copyright'] $this->data['copyright'] + $this->data['copyright'] + $this->data['datemodified'] $this->data['datemodified'] $this->data['datemodified'] $this->data['description'] $this->data['description'] + $this->data['description'] + $this->data['feedlink'] $this->data['feedlink'] $this->data['feedlink'] $this->data['generator'] $this->data['generator'] + $this->data['generator'] $this->data['hubs'] $this->data['id'] $this->data['id'] + $this->data['id'] $this->data['image'] $this->data['language'] $this->data['language'] + $this->data['language'] $this->data['lastBuildDate'] $this->data['link'] $this->data['link'] + $this->data['link'] + $this->data['title'] $this->data['title'] $this->data['title'] null|array<string, string> + + $categoryCollection + $this->data['authors'] $this->data['datemodified'] @@ -1761,15 +1902,18 @@ - + + $this + + $this->offsetGet('href') - + + + $this->offsetGet('href') + - - $value - $value @@ -1778,6 +1922,9 @@ $value $value + + $value + addHeaderLine @@ -1789,7 +1936,8 @@ getHeaderLine - + + $default $default @@ -1815,7 +1963,8 @@ getHeaderLine - + + $this->headers[$normalizedName] ?? $default $this->headers[$normalizedName] ?? $default @@ -1832,28 +1981,23 @@ - - trim($responseHtml) - trim($string) - - + ExtensionManagerInterface ExtensionManagerInterface null|ExtensionManagerInterface - + ! static::$httpClient gettype($response) static::$httpClient - - Feed\FeedInterface - - + + $array $reader - + Feed\FeedInterface + TInput $data @@ -1931,27 +2075,6 @@ - - ! is_string($copyright) - ! is_string($description) - ! is_string($encoding) - ! is_string($id) - ! is_string($language) - ! is_string($link) - ! is_string($link) - ! is_string($name) - ! is_string($title) - ! is_string($uri) - ! is_string($url) - ! is_string($url) - ! is_string($version) - empty($id) || ! is_string($id) - empty($link) || ! is_string($link) - empty($link) || ! is_string($link) - empty($uri) || ! is_string($uri) - empty($url) || ! is_string($url) - empty($url) || ! is_string($url) - $author $category @@ -2026,11 +2149,28 @@ $extensions $type + + ! is_string($copyright) + ! is_string($description) + ! is_string($encoding) + ! is_string($id) + ! is_string($language) + ! is_string($link) + ! is_string($link) + ! is_string($name) + ! is_string($uri) + ! is_string($url) + ! is_string($url) + ! is_string($version) + empty($id) || ! is_string($id) + empty($link) || ! is_string($link) + empty($link) || ! is_string($link) + empty($uri) || ! is_string($uri) + empty($url) || ! is_string($url) + empty($url) || ! is_string($url) + - - ! is_string($reference) - $type @@ -2048,20 +2188,11 @@ $this->data['reference'] $this->data['when'] + + ! is_string($reference) + - - ! is_string($content) - ! is_string($copyright) - ! is_string($description) - ! is_string($encoding) - ! is_string($id) - ! is_string($link) - ! is_string($link) - ! is_string($title) - empty($link) || ! is_string($link) - empty($link) || ! is_string($link) - $author $category @@ -2130,9 +2261,46 @@ $type + + ! is_string($content) + ! is_string($copyright) + ! is_string($description) + ! is_string($encoding) + ! is_string($id) + ! is_string($link) + ! is_string($link) + empty($link) || ! is_string($link) + empty($link) || ! is_string($link) + - + + $this + $this + $this + $this + $this + $this + $this + $this + $this + $this + $this + $this + $this + $this + $this + $this + $this + $this + $this + $this + $this + $this + $this + $this + $this + $this $this $this @@ -2358,6 +2526,10 @@ $value + + $value + $value + (int) $number (int) $number @@ -2598,12 +2770,10 @@ - + ?ExtensionManagerInterface - ExtensionManagerInterface - - ExtensionManager + ExtensionManagerInterface Extension\AbstractRenderer @@ -2618,36 +2788,26 @@ + + getTimestamp + getTimestamp + + + $this->entries + new $renderClass($this) - - $this->entries[$this->key()] - - - $entries[$timestamp] - $entry - - - Entry - Entry + string - - getDateCreated - getDateCreated - getDateModified - getDateModified - getTimestamp - getTimestamp + ignoreExceptions render saveXml - + $renderer->render()->saveXml() - $this->entries[$index] - $this->entries[$this->key()] $this->getEncoding() @@ -2659,8 +2819,8 @@ - gettype($data) - gettype($entries) + ! is_array($data) && ! $data instanceof Traversable + ! is_array($entries) && ! $entries instanceof Traversable $key @@ -2671,15 +2831,10 @@ $key - + $key $value - $value - - is_object($data) - is_object($entries) - @@ -2706,9 +2861,6 @@ - - empty($data) - $this @@ -2763,9 +2915,6 @@ setRootElement setType - - ! $authors || empty($authors) - $this->container->getEncoding() $this->getDataContainer()->getDescription() @@ -2784,11 +2933,11 @@ Atom Atom + + empty($data) + - - empty($data) - $this @@ -2817,11 +2966,11 @@ Deleted Deleted + + empty($data) + - - empty($data) - $this @@ -2850,11 +2999,11 @@ AtomDeleted AtomDeleted + + empty($data) + - - empty($data) - $this @@ -2903,9 +3052,6 @@ $data['email'] $data['name'] - - ! $authors || empty($authors) - $this->container->getEncoding() $this->getDataContainer()->getDescription() @@ -2919,6 +3065,9 @@ Rss Rss + + empty($data) + @@ -2962,9 +3111,6 @@ $hubUrl $type - - ! $authors || empty($authors) - $gdata['uri'] $gdata['version'] @@ -3054,9 +3200,6 @@ $hubUrl $type - - ! $authors || empty($authors) - $gdata['uri'] $gdata['version'] @@ -3192,9 +3335,6 @@ $name $name - - ! $authors || empty($authors) - $this->container->getEncoding() @@ -3241,11 +3381,11 @@ - + ExtensionManagerInterface ExtensionManagerInterface ExtensionManagerInterface - + static::$extensions['entry'] static::$extensions['entryRenderer'] @@ -3289,18 +3429,10 @@ - - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - - + 123 123 - + @@ -3314,14 +3446,9 @@ setMethods setMethods - + $this->tableGateway '' - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class new stdClass() @@ -3356,7 +3483,8 @@ getenv('TESTS_LAMINAS_FEED_PUBSUBHUBBUB_BASEURI') - + + getSubscription getSubscription @@ -3368,31 +3496,13 @@ setMethods - - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - - + '0aa' '10000' 123 123 123 - + @@ -3417,127 +3527,16 @@ - - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - - - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - - - getAuthor - getAuthor - getAuthors - getAuthors + getBaseUrl getBaseUrl - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCommentLink - getCommentLink - getCommentLink - getContent - getContent - getContent - getContent - getContent - getContent - getDateCreated - getDateCreated - getDateCreated - getDateModified - getDateModified - getDateModified - getDescription - getDescription - getEnclosure - getEnclosure - getId - getId - getLink - getLink - getLink - getLink - getTitle - getTitle - getValues - getValues - getValues - getValues - getValues - getValues - + $entry->getElement()->tagName - - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - - + getDomDocument getElement getElement @@ -3546,665 +3545,17 @@ getEncoding getExtension getExtension - getId - getId getType getXpath getXpathPrefix saveXml - - - $entry->getElement()->tagName - - - - - public function dateModifiedProvider(): array - - - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - $entry->getCategories()->getValues() - - - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - - - array<int,<array{0:string,1:DateTimeInterface|null}>> - - - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthor - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getAuthors - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCategories - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentCount - getCommentFeedLink - getCommentFeedLink - getCommentFeedLink - getCommentFeedLink - getCommentFeedLink - getCommentFeedLink - getCommentFeedLink - getCommentFeedLink - getCommentFeedLink - getCommentFeedLink - getCommentFeedLink - getCommentFeedLink - getCommentFeedLink - getCommentFeedLink - getCommentFeedLink - getCommentFeedLink - getCommentFeedLink - getCommentFeedLink - getCommentFeedLink - getCommentFeedLink - getCommentFeedLink - getCommentLink - getCommentLink - getCommentLink - getCommentLink - getCommentLink - getCommentLink - getCommentLink - getCommentLink - getCommentLink - getCommentLink - getCommentLink - getCommentLink - getCommentLink - getCommentLink - getCommentLink - getCommentLink - getCommentLink - getCommentLink - getCommentLink - getContent - getContent - getContent - getContent - getContent - getContent - getContent - getContent - getContent - getContent - getContent - getContent - getContent - getContent - getContent - getContent - getContent - getContent - getContent - getContent - getContent - getDateModified - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getDescription - getEnclosure - getEnclosure - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getId - getLink - getLink - getLink - getLink - getLink - getLink - getLink - getLink - getLink - getLink - getLink - getLink - getLink - getLink - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getTitle - getValues - getValues - getValues - getValues - getValues - getValues - getValues - getValues - getValues - getValues - getValues + + + + + public function dateModifiedProvider(): array + + getValues getValues getValues @@ -4220,6 +3571,11 @@ getValues getValues getValues + + + array<int,<array{0:string,1:DateTimeInterface|null}>> + + getValues getValues getValues @@ -4235,7 +3591,7 @@ getValues getValues getValues - + @@ -4261,7 +3617,7 @@ $source $source - + getAuthors getCategories getCategories @@ -4275,6 +3631,10 @@ getId getLanguage getLink + getTitle + getValues + + getSource getSource getSource @@ -4290,9 +3650,7 @@ getSource getSource getSource - getTitle - getValues - + @@ -4495,39 +3853,15 @@ $statusCode - - - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - - + + getCastAuthor getDuration - getEnclosure getEncoding getEpisode getEpisode getEpisodeType getEpisodeType - getId getItunesImage getPlayPodcastBlock getPlayPodcastDescription @@ -4535,11 +3869,10 @@ getSeason getSeason getSubtitle - getTitle isClosedCaptioned isClosedCaptioned isClosedCaptioned - + getEncoding getNewFeedUrl @@ -4558,30 +3891,9 @@ - - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - - - getAuthor - getAuthors - getContent - getDescription + getEncoding - getId - getLink - getLinks - getPermaLink - getTitle - + (array) $feed->getAuthors() @@ -4590,30 +3902,9 @@ - - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - - - getAuthor - getAuthors - getContent - getDescription + getEncoding - getId - getLink - getLinks - getPermaLink - getTitle - + (array) $feed->getAuthors() @@ -4622,53 +3913,29 @@ - - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry + $keywords - + getBlock getCastAuthor getDuration - getEnclosure getEncoding getEpisode getEpisode getEpisodeType getEpisodeType getExplicit - getId getItunesImage getKeywords getSeason getSeason getSubtitle getSummary - getTitle isClosedCaptioned isClosedCaptioned isClosedCaptioned - + getBlock getCastAuthor @@ -4686,33 +3953,9 @@ - - $entry->getContent() - - - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - - - getAuthor - getAuthors - getContent - getDescription + getEncoding - getId - getLink - getLinks - getPermaLink - getTitle - + (array) $feed->getAuthors() @@ -4721,30 +3964,9 @@ - - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - - - getAuthor - getAuthors - getContent - getDescription + getEncoding - getId - getLink - getLinks - getPermaLink - getTitle - + (array) $feed->getAuthors() @@ -4772,18 +3994,16 @@ new stdClass() + + $link['feed'] + $message - - $link['feed'] - - + $link - - getEncoding - + getEncoding @@ -4822,16 +4042,9 @@ assertNull - - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - - + 'abc' - + $entry = new Writer\Deleted(); $entry->setBy(['name' => 'Joe', 'uri' => 'notauri']); @@ -4839,28 +4052,10 @@ - - ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - - + 'abc' 'abc' - + $count $message @@ -4877,50 +4072,13 @@ $this->expectException(ExceptionInterface::class); - - - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - - - - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - testSetPlayPodcastImageRaisesExceptionForInvalidUrl testSetPlayPodcastImageSetsInternalDataWithValidUrl - - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - testEpisodeTypeMaybeMutatedWithAcceptedValues testSetEpisodeRaisesExceptionForNonNumericEpisodeNumbers @@ -4933,26 +4091,6 @@ - - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - testSetExplicit testSetItunesCompleteRaisesExceptionForInvalidStatus @@ -4974,33 +4112,7 @@ - - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - Writer\Exception\ExceptionInterface::class - + getTimestamp getTimestamp @@ -5021,64 +4133,26 @@ - - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - + $message - - $enc - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - - - getAuthor - getCategories - getCommentCount - getCommentFeedLink - getCommentLink - getContent - getDateCreated - getDateModified - getDescription - getEnclosure - getEncoding - getEncoding - getId - getId - getId - getId - getLink - getLink - getTimestamp - getTimestamp - getTitle - - + $enc->length $enc->type $enc->url - + + + getTimestamp + getTimestamp + + + getEncoding + getEncoding + + + getCommentFeedLink + $atomFeed = new Renderer\Feed\Atom($this->validWriter); $atomFeed->render(); @@ -5089,80 +4163,29 @@ - - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - + $message - - $enc - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - $entry - - - getAuthor - getAuthor - getCategories - getCategories - getCommentCount - getCommentFeedLink - getCommentLink - getContent - getContent - getDateCreated - getDateModified - getDescription - getDescription - getEnclosure - getEncoding - getEncoding - getId - getId - getLink - getLink - getTimestamp - getTimestamp - getTitle - getTitle - - + $enc->length $enc->type $enc->url - + + + getTimestamp + getTimestamp + + + getEncoding + getEncoding + + + getCommentFeedLink + - - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - + $message @@ -5178,22 +4201,7 @@ - - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - ExceptionInterface::class - + $feed->getDomDocument() $message diff --git a/psalm.xml b/psalm.xml index f0968ffd..d6564264 100644 --- a/psalm.xml +++ b/psalm.xml @@ -19,20 +19,6 @@ - - - - - - - - - - - - - - From 32bde65a32d1209c8328f8bbb43cf3a46f5187e8 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 04:17:57 +0100 Subject: [PATCH 20/21] Applied automated CS fixes --- src/Reader/ExtensionPluginManager.php | 1 - src/Reader/Feed/AbstractFeed.php | 1 - src/Reader/Reader.php | 4 +-- src/Writer/ExtensionPluginManager.php | 42 +++++++++++++-------------- 4 files changed, 22 insertions(+), 26 deletions(-) diff --git a/src/Reader/ExtensionPluginManager.php b/src/Reader/ExtensionPluginManager.php index 4a2e5c9e..fe24057a 100644 --- a/src/Reader/ExtensionPluginManager.php +++ b/src/Reader/ExtensionPluginManager.php @@ -25,7 +25,6 @@ * @psalm-import-type FactoriesConfigurationType from ConfigInterface * @final this class wasn't designed to be inherited from, but we can't assume that consumers haven't already * extended it, therefore we cannot add the final marker without a new major release. - * * @template InstanceType of AbstractEntry|AbstractFeed * @template-extends AbstractPluginManager */ diff --git a/src/Reader/Feed/AbstractFeed.php b/src/Reader/Feed/AbstractFeed.php index 659b0221..5a4930dd 100644 --- a/src/Reader/Feed/AbstractFeed.php +++ b/src/Reader/Feed/AbstractFeed.php @@ -8,7 +8,6 @@ use DOMElement; use DOMXPath; use Laminas\Feed\Reader; -use Laminas\Feed\Reader\Entry\EntryInterface; use Laminas\Feed\Reader\Exception; // phpcs:ignore SlevomatCodingStandard.Namespaces.UnusedUses.UnusedUse use ReturnTypeWillChange; diff --git a/src/Reader/Reader.php b/src/Reader/Reader.php index 81de1151..3cb729e3 100644 --- a/src/Reader/Reader.php +++ b/src/Reader/Reader.php @@ -753,11 +753,9 @@ protected static function registerCoreExtensions() /** * Utility method to apply array_unique operation to a multidimensional * array. - * - * @template TInput of array * + * @template TInput of array * @param TInput $array - * * @return TInput */ public static function arrayUnique(array $array) diff --git a/src/Writer/ExtensionPluginManager.php b/src/Writer/ExtensionPluginManager.php index 7206e305..8f1c63e8 100644 --- a/src/Writer/ExtensionPluginManager.php +++ b/src/Writer/ExtensionPluginManager.php @@ -4,6 +4,8 @@ namespace Laminas\Feed\Writer; +use Laminas\Feed\Writer\Extension\GooglePlayPodcast\Feed; +use Laminas\Feed\Writer\Extension\ITunes\Entry; use Laminas\ServiceManager\AbstractPluginManager; use Laminas\ServiceManager\ConfigInterface; use Laminas\ServiceManager\Exception\InvalidServiceException; @@ -21,9 +23,7 @@ * Validation checks that we have an Entry, Feed, or Extension\AbstractRenderer. * * @psalm-import-type FactoriesConfigurationType from ConfigInterface - * - * @template InstanceType of Extension\AbstractRenderer|\Laminas\Feed\Writer\Extension\GooglePlayPodcast\Entry|\Laminas\Feed\Writer\Extension\GooglePlayPodcast\Feed|\Laminas\Feed\Writer\Extension\ITunes\Entry|\Laminas\Feed\Writer\Extension\ITunes\Feed|\Laminas\Feed\Writer\Extension\PodcastIndex\Entry|\Laminas\Feed\Writer\Extension\PodcastIndex\Feed - * + * @template InstanceType of Extension\AbstractRenderer|Entry|Feed|Entry|\Laminas\Feed\Writer\Extension\ITunes\Feed|\Laminas\Feed\Writer\Extension\PodcastIndex\Entry|\Laminas\Feed\Writer\Extension\PodcastIndex\Feed * @template-extends AbstractPluginManager */ class ExtensionPluginManager extends AbstractPluginManager implements ExtensionManagerInterface @@ -61,12 +61,12 @@ class ExtensionPluginManager extends AbstractPluginManager implements ExtensionM 'GooglePlayPodcastEntry' => Extension\GooglePlayPodcast\Entry::class, 'Googleplaypodcast\Entry' => Extension\GooglePlayPodcast\Entry::class, 'GooglePlayPodcast\Entry' => Extension\GooglePlayPodcast\Entry::class, - 'googleplaypodcastfeed' => Extension\GooglePlayPodcast\Feed::class, - 'googleplaypodcastFeed' => Extension\GooglePlayPodcast\Feed::class, - 'googlePlayPodcastFeed' => Extension\GooglePlayPodcast\Feed::class, - 'GooglePlayPodcastFeed' => Extension\GooglePlayPodcast\Feed::class, - 'Googleplaypodcast\Feed' => Extension\GooglePlayPodcast\Feed::class, - 'GooglePlayPodcast\Feed' => Extension\GooglePlayPodcast\Feed::class, + 'googleplaypodcastfeed' => Feed::class, + 'googleplaypodcastFeed' => Feed::class, + 'googlePlayPodcastFeed' => Feed::class, + 'GooglePlayPodcastFeed' => Feed::class, + 'Googleplaypodcast\Feed' => Feed::class, + 'GooglePlayPodcast\Feed' => Feed::class, 'googleplaypodcastrendererentry' => Extension\GooglePlayPodcast\Renderer\Entry::class, 'googleplaypodcastRendererEntry' => Extension\GooglePlayPodcast\Renderer\Entry::class, 'googlePlayPodcastRendererEntry' => Extension\GooglePlayPodcast\Renderer\Entry::class, @@ -79,12 +79,12 @@ class ExtensionPluginManager extends AbstractPluginManager implements ExtensionM 'GooglePlayPodcastRendererFeed' => Extension\GooglePlayPodcast\Renderer\Feed::class, 'GoogleplaypodcastRenderer\Feed' => Extension\GooglePlayPodcast\Renderer\Feed::class, 'GooglePlayPodcast\Renderer\Feed' => Extension\GooglePlayPodcast\Renderer\Feed::class, - 'itunesentry' => Extension\ITunes\Entry::class, - 'itunesEntry' => Extension\ITunes\Entry::class, - 'iTunesEntry' => Extension\ITunes\Entry::class, - 'ItunesEntry' => Extension\ITunes\Entry::class, - 'Itunes\Entry' => Extension\ITunes\Entry::class, - 'ITunes\Entry' => Extension\ITunes\Entry::class, + 'itunesentry' => Entry::class, + 'itunesEntry' => Entry::class, + 'iTunesEntry' => Entry::class, + 'ItunesEntry' => Entry::class, + 'Itunes\Entry' => Entry::class, + 'ITunes\Entry' => Entry::class, 'itunesfeed' => Extension\ITunes\Feed::class, 'itunesFeed' => Extension\ITunes\Feed::class, 'iTunesFeed' => Extension\ITunes\Feed::class, @@ -143,10 +143,10 @@ class ExtensionPluginManager extends AbstractPluginManager implements ExtensionM 'Zend\Feed\Writer\Extension\DublinCore\Renderer\Entry' => Extension\DublinCore\Renderer\Entry::class, 'Zend\Feed\Writer\Extension\DublinCore\Renderer\Feed' => Extension\DublinCore\Renderer\Feed::class, 'Zend\Feed\Writer\Extension\GooglePlayPodcast\Entry' => Extension\GooglePlayPodcast\Entry::class, - 'Zend\Feed\Writer\Extension\GooglePlayPodcast\Feed' => Extension\GooglePlayPodcast\Feed::class, + 'Zend\Feed\Writer\Extension\GooglePlayPodcast\Feed' => Feed::class, 'Zend\Feed\Writer\Extension\GooglePlayPodcast\Renderer\Entry' => Extension\GooglePlayPodcast\Renderer\Entry::class, 'Zend\Feed\Writer\Extension\GooglePlayPodcast\Renderer\Feed' => Extension\GooglePlayPodcast\Renderer\Feed::class, - 'Zend\Feed\Writer\Extension\ITunes\Entry' => Extension\ITunes\Entry::class, + 'Zend\Feed\Writer\Extension\ITunes\Entry' => Entry::class, 'Zend\Feed\Writer\Extension\ITunes\Feed' => Extension\ITunes\Feed::class, 'Zend\Feed\Writer\Extension\ITunes\Renderer\Entry' => Extension\ITunes\Renderer\Entry::class, 'Zend\Feed\Writer\Extension\ITunes\Renderer\Feed' => Extension\ITunes\Renderer\Feed::class, @@ -160,10 +160,10 @@ class ExtensionPluginManager extends AbstractPluginManager implements ExtensionM 'zendfeedwriterextensiondublincorerendererentry' => Extension\DublinCore\Renderer\Entry::class, 'zendfeedwriterextensiondublincorerendererfeed' => Extension\DublinCore\Renderer\Feed::class, 'zendfeedwriterextensiongoogleplaypodcastentry' => Extension\GooglePlayPodcast\Entry::class, - 'zendfeedwriterextensiongoogleplaypodcastfeed' => Extension\GooglePlayPodcast\Feed::class, + 'zendfeedwriterextensiongoogleplaypodcastfeed' => Feed::class, 'zendfeedwriterextensiongoogleplaypodcastrendererentry' => Extension\GooglePlayPodcast\Renderer\Entry::class, 'zendfeedwriterextensiongoogleplaypodcastrendererfeed' => Extension\GooglePlayPodcast\Renderer\Feed::class, - 'zendfeedwriterextensionitunesentry' => Extension\ITunes\Entry::class, + 'zendfeedwriterextensionitunesentry' => Entry::class, 'zendfeedwriterextensionitunesfeed' => Extension\ITunes\Feed::class, 'zendfeedwriterextensionitunesrendererentry' => Extension\ITunes\Renderer\Entry::class, 'zendfeedwriterextensionitunesrendererfeed' => Extension\ITunes\Renderer\Feed::class, @@ -184,10 +184,10 @@ class ExtensionPluginManager extends AbstractPluginManager implements ExtensionM Extension\DublinCore\Renderer\Entry::class => InvokableFactory::class, Extension\DublinCore\Renderer\Feed::class => InvokableFactory::class, Extension\GooglePlayPodcast\Entry::class => InvokableFactory::class, - Extension\GooglePlayPodcast\Feed::class => InvokableFactory::class, + Feed::class => InvokableFactory::class, Extension\GooglePlayPodcast\Renderer\Entry::class => InvokableFactory::class, Extension\GooglePlayPodcast\Renderer\Feed::class => InvokableFactory::class, - Extension\ITunes\Entry::class => InvokableFactory::class, + Entry::class => InvokableFactory::class, Extension\ITunes\Feed::class => InvokableFactory::class, Extension\ITunes\Renderer\Entry::class => InvokableFactory::class, Extension\ITunes\Renderer\Feed::class => InvokableFactory::class, From 3ee6e37966f73379c523909d9126f87eef52b232 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 3 Dec 2022 04:20:47 +0100 Subject: [PATCH 21/21] Disable camel-case variable declaration checks for closure with unused parameters --- test/Writer/EntryTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/Writer/EntryTest.php b/test/Writer/EntryTest.php index 7750ea74..c08bf070 100644 --- a/test/Writer/EntryTest.php +++ b/test/Writer/EntryTest.php @@ -767,11 +767,13 @@ public function testEntryWriterEmitsNoticeDuringFeedImportWhenGooglePlayPodcastE 'messages' => [], ]; + // phpcs:disable WebimpressCodingStandard.NamingConventions.ValidVariableName.NotCamelCaps set_error_handler(static function (int $_errno, string $errstr) use ($notices): ?bool { $notices->messages[] = $errstr; return null; }, E_USER_NOTICE); + // phpcs:enable WebimpressCodingStandard.NamingConventions.ValidVariableName.NotCamelCaps new Writer\Entry(); restore_error_handler();