diff --git a/composer.lock b/composer.lock index 1ece3e34..c11860ba 100644 --- a/composer.lock +++ b/composer.lock @@ -745,16 +745,16 @@ }, { "name": "doctrine/annotations", - "version": "1.14.1", + "version": "1.14.2", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "9e034d7a70032d422169f27d8759e8d84abb4f51" + "reference": "ad785217c1e9555a7d6c6c8c9f406395a5e2882b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/9e034d7a70032d422169f27d8759e8d84abb4f51", - "reference": "9e034d7a70032d422169f27d8759e8d84abb4f51", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/ad785217c1e9555a7d6c6c8c9f406395a5e2882b", + "reference": "ad785217c1e9555a7d6c6c8c9f406395a5e2882b", "shasum": "" }, "require": { @@ -815,9 +815,9 @@ ], "support": { "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.14.1" + "source": "https://github.com/doctrine/annotations/tree/1.14.2" }, - "time": "2022-12-12T12:46:12+00:00" + "time": "2022-12-15T06:48:22+00:00" }, { "name": "doctrine/deprecations", @@ -1823,59 +1823,6 @@ }, "time": "2022-11-12T15:38:23+00:00" }, - { - "name": "openlss/lib-array2xml", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/nullivex/lib-array2xml.git", - "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", - "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "type": "library", - "autoload": { - "psr-0": { - "LSS": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Bryan Tong", - "email": "bryan@nullivex.com", - "homepage": "https://www.nullivex.com" - }, - { - "name": "Tony Butler", - "email": "spudz76@gmail.com", - "homepage": "https://www.nullivex.com" - } - ], - "description": "Array2XML conversion library credit to lalit.org", - "homepage": "https://www.nullivex.com", - "keywords": [ - "array", - "array conversion", - "xml", - "xml conversion" - ], - "support": { - "issues": "https://github.com/nullivex/lib-array2xml/issues", - "source": "https://github.com/nullivex/lib-array2xml/tree/master" - }, - "time": "2019-03-29T20:06:56+00:00" - }, { "name": "phar-io/manifest", "version": "2.0.3", @@ -2390,16 +2337,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.21", + "version": "9.2.22", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0" + "reference": "e4bf60d2220b4baaa0572986b5d69870226b06df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/3f893e19712bb0c8bc86665d1562e9fd509c4ef0", - "reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e4bf60d2220b4baaa0572986b5d69870226b06df", + "reference": "e4bf60d2220b4baaa0572986b5d69870226b06df", "shasum": "" }, "require": { @@ -2455,7 +2402,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.21" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.22" }, "funding": [ { @@ -2463,7 +2410,7 @@ "type": "github" } ], - "time": "2022-12-14T13:26:54+00:00" + "time": "2022-12-18T16:40:55+00:00" }, { "name": "phpunit/php-file-iterator", @@ -4104,6 +4051,70 @@ ], "time": "2022-05-25T10:58:12+00:00" }, + { + "name": "spatie/array-to-xml", + "version": "2.17.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/array-to-xml.git", + "reference": "df0f116f26f6d3f84041e94d46811ee6b64fe7d5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/df0f116f26f6d3f84041e94d46811ee6b64fe7d5", + "reference": "df0f116f26f6d3f84041e94d46811ee6b64fe7d5", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "php": "^7.4|^8.0" + }, + "require-dev": { + "mockery/mockery": "^1.2", + "pestphp/pest": "^1.21", + "phpunit/phpunit": "^9.0", + "spatie/pest-plugin-snapshots": "^1.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\ArrayToXml\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://freek.dev", + "role": "Developer" + } + ], + "description": "Convert an array to xml", + "homepage": "https://github.com/spatie/array-to-xml", + "keywords": [ + "array", + "convert", + "xml" + ], + "support": { + "source": "https://github.com/spatie/array-to-xml/tree/2.17.0" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2022-12-13T09:08:39+00:00" + }, { "name": "squizlabs/php_codesniffer", "version": "3.7.1", @@ -5207,16 +5218,16 @@ }, { "name": "vimeo/psalm", - "version": "5.2.0", + "version": "5.4.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "fb685a16df3050d4c18d8a4100fe83abe6458cba" + "reference": "62db5d4f6a7ae0a20f7cc5a4952d730272fc0863" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/fb685a16df3050d4c18d8a4100fe83abe6458cba", - "reference": "fb685a16df3050d4c18d8a4100fe83abe6458cba", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/62db5d4f6a7ae0a20f7cc5a4952d730272fc0863", + "reference": "62db5d4f6a7ae0a20f7cc5a4952d730272fc0863", "shasum": "" }, "require": { @@ -5238,9 +5249,9 @@ "fidry/cpu-core-counter": "^0.4.0", "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", "nikic/php-parser": "^4.13", - "openlss/lib-array2xml": "^1.0", "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0", "sebastian/diff": "^4.0", + "spatie/array-to-xml": "^2.17.0", "symfony/console": "^4.1.6 || ^5.0 || ^6.0", "symfony/filesystem": "^5.4 || ^6.0", "symfony/polyfill-php80": "^1.25" @@ -5306,9 +5317,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/5.2.0" + "source": "https://github.com/vimeo/psalm/tree/5.4.0" }, - "time": "2022-12-12T08:18:56+00:00" + "time": "2022-12-19T21:31:12+00:00" }, { "name": "webimpress/coding-standard", diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 7a5b246b..6b4bc5c0 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + null === $this->eventManager diff --git a/src/HydratorPluginManagerFactory.php b/src/HydratorPluginManagerFactory.php index 224b58b7..8365f356 100644 --- a/src/HydratorPluginManagerFactory.php +++ b/src/HydratorPluginManagerFactory.php @@ -46,9 +46,7 @@ public function __invoke(ContainerInterface $container, string $name, ?array $op )); } - /** @psalm-var ServiceManagerConfiguration $options */ - $options = is_array($options) ? $options : []; - $pluginManager = new HydratorPluginManager($container, $options); + $pluginManager = new HydratorPluginManager($container, $options ?? []); // If this is in a laminas-mvc application, the ServiceListener will inject // merged configuration during bootstrap. diff --git a/test/Strategy/CollectionStrategyTest.php b/test/Strategy/CollectionStrategyTest.php index 1c3c742b..18055483 100644 --- a/test/Strategy/CollectionStrategyTest.php +++ b/test/Strategy/CollectionStrategyTest.php @@ -9,11 +9,9 @@ use Laminas\Hydrator\HydratorInterface; use Laminas\Hydrator\ReflectionHydrator; use Laminas\Hydrator\Strategy\CollectionStrategy; -use Laminas\Hydrator\Strategy\StrategyInterface; use LaminasTest\Hydrator\TestAsset; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; -use ReflectionClass; use stdClass; use Throwable; use TypeError; @@ -35,17 +33,6 @@ */ class CollectionStrategyTest extends TestCase { - public function testImplementsStrategyInterface(): void - { - $reflection = new ReflectionClass(CollectionStrategy::class); - - self::assertTrue($reflection->implementsInterface(StrategyInterface::class), sprintf( - 'Failed to assert that "%s" implements "%s"', - CollectionStrategy::class, - StrategyInterface::class - )); - } - /** * @dataProvider providerInvalidObjectClassName * @param class-string $expectedExceptionType diff --git a/test/Strategy/HydratorStrategyTest.php b/test/Strategy/HydratorStrategyTest.php index 23304587..7e7f5b94 100644 --- a/test/Strategy/HydratorStrategyTest.php +++ b/test/Strategy/HydratorStrategyTest.php @@ -45,10 +45,9 @@ public function testConstructorRejectsInvalidObjectClassName( ); } - /** @return array, string}> */ + /** @return non-empty-array, string}> */ public function providerInvalidObjectClassName(): array { - // @codingStandardsIgnoreStart return [ 'array' => [[], TypeError::class, 'type string'], 'boolean-false' => [false, TypeError::class, 'type string'], @@ -58,9 +57,12 @@ public function providerInvalidObjectClassName(): array 'null' => [null, TypeError::class, 'type string'], 'object' => [new stdClass(), TypeError::class, 'type string'], 'resource' => [fopen(__FILE__, 'r'), TypeError::class, 'type string'], - 'string-non-existent-class' => ['FooBarBaz9000', InvalidArgumentException::class, 'class name needs to be the name of an existing class'], + 'string-non-existent-class' => [ + 'FooBarBaz9000', + InvalidArgumentException::class, + 'class name needs to be the name of an existing class', + ], ]; - // @codingStandardsIgnoreEnd } /**