Skip to content

Commit

Permalink
Merge pull request #102 from laminas/renovate/lock-file-maintenance
Browse files Browse the repository at this point in the history
Removed internal redundant type checks, updated `vimeo/psalm`
  • Loading branch information
Ocramius committed Dec 21, 2022
2 parents e828f58 + e1a12b5 commit 78fa8f8
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 93 deletions.
155 changes: 83 additions & 72 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.1.0@4defa177c89397c5e14737a80fe4896584130674">
<files psalm-version="5.4.0@62db5d4f6a7ae0a20f7cc5a4952d730272fc0863">
<file src="src/Aggregate/AggregateHydrator.php">
<DocblockTypeContradiction occurrences="1">
<code>null === $this-&gt;eventManager</code>
Expand Down
4 changes: 1 addition & 3 deletions src/HydratorPluginManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
13 changes: 0 additions & 13 deletions test/Strategy/CollectionStrategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<Throwable> $expectedExceptionType
Expand Down
10 changes: 6 additions & 4 deletions test/Strategy/HydratorStrategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ public function testConstructorRejectsInvalidObjectClassName(
);
}

/** @return array<string, array{0: mixed, class-string<Throwable>, string}> */
/** @return non-empty-array<non-empty-string, array{mixed, class-string<Throwable>, string}> */
public function providerInvalidObjectClassName(): array
{
// @codingStandardsIgnoreStart
return [
'array' => [[], TypeError::class, 'type string'],
'boolean-false' => [false, TypeError::class, 'type string'],
Expand All @@ -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
}

/**
Expand Down

0 comments on commit 78fa8f8

Please sign in to comment.