misc: bump dev-dependencies

This commit is contained in:
Romain Canon 2022-05-06 13:56:16 +02:00
parent c08fe5a3c5
commit 8443847cb8
17 changed files with 372 additions and 369 deletions

661
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -73,16 +73,10 @@ use function call_user_func;
/** @internal */
final class Container
{
/**
* @template T of object
* @var array<class-string<T>, T>
*/
/** @var array<class-string, object> */
private array $services = [];
/**
* @template T of object
* @var array<class-string<T>, callable(): T>
*/
/** @var array<class-string, callable(): object> */
private array $factories;
public function __construct(Settings $settings)
@ -255,8 +249,11 @@ final class Container
*/
private function wrapCache(CacheInterface $cache): CacheInterface
{
/** @var RuntimeCache<EntryType> $runtimeCache */
$runtimeCache = new RuntimeCache();
return new VersionedCache(
new ChainCache(new RuntimeCache(), $cache)
new ChainCache($runtimeCache, $cache)
);
}
}

View File

@ -12,9 +12,7 @@ interface TreeMapper
*
* @param string|class-string<T> $signature
* @param mixed $source
* @return T|mixed
*
* @psalm-return (
* @return (
* $signature is class-string<T>
* ? T
* : mixed

View File

@ -14,6 +14,6 @@ final class Package
public static function version(): string
{
/** @infection-ignore-all */
return self::$version ??= InstalledVersions::getVersion('cuyz/valinor');
return self::$version ??= InstalledVersions::getVersion('cuyz/valinor') ?? 'unknown';
}
}

View File

@ -12,6 +12,7 @@ use Reflector;
use function array_shift;
use function explode;
use function get_class;
use function implode;
use function strtolower;
@ -20,7 +21,7 @@ final class ClassAliasParser
{
use IsSingleton;
/** @var array<class-string, array<string, string>> */
/** @var array<string, array<string, string>> */
private array $aliases = [];
/**
@ -62,6 +63,6 @@ final class ClassAliasParser
private function aliases(Reflector $reflection): array
{
/** @infection-ignore-all */
return $this->aliases[$reflection->name] ??= Singleton::phpParser()->parseUseStatements($reflection);
return $this->aliases[get_class($reflection) . $reflection->name] ??= Singleton::phpParser()->parseUseStatements($reflection);
}
}

View File

@ -7,5 +7,5 @@ namespace CuyZ\Valinor\Tests\Integration\Mapping\Fixture;
// @PHP8.1 move inside \CuyZ\Valinor\Tests\Integration\Mapping\ReadonlyMappingTest
final class ReadonlyValues
{
public readonly string $value;
public readonly string $value; // @phpstan-ignore-line
}

View File

@ -50,10 +50,10 @@ final class GenericValuesMappingTest extends IntegrationTest
self::assertSame(true, $result->genericWithBoolean->value);
self::assertSame(42.404, $result->genericWithFloat->value);
self::assertSame(1337, $result->genericWithInteger->value);
self::assertSame(1337, $result->genericWithIntegerValue->value);
self::assertSame(1337, $result->genericWithIntegerValue->value); // @phpstan-ignore-line
self::assertSame('foo', $result->genericWithString->value);
self::assertSame('foo', $result->genericWithSingleQuoteStringValue->value);
self::assertSame('foo', $result->genericWithDoubleQuoteStringValue->value);
self::assertSame('foo', $result->genericWithSingleQuoteStringValue->value); // @phpstan-ignore-line
self::assertSame('foo', $result->genericWithDoubleQuoteStringValue->value); // @phpstan-ignore-line
self::assertSame(['foo', 'bar', 'baz'], $result->genericWithArrayOfStrings->value);
self::assertSame(['foo', 'bar', 'baz'], $result->genericWithSimpleArrayOfStrings->value);
self::assertSame('foo', $result->genericWithUnionOfScalar->value);
@ -65,8 +65,8 @@ final class GenericValuesMappingTest extends IntegrationTest
self::assertSame(42, $result->genericWithTwoTemplatesOnSeveralLines->valueB);
self::assertSame('foo', $result->genericWithSpecifiedTypeWithString->value);
self::assertSame('foo', $result->genericWithSpecifiedTypeWithObject->value->value);
self::assertSame(42, $result->genericWithSpecifiedTypeWithIntegerValue->value);
self::assertSame('foo', $result->genericWithSpecifiedTypeWithStringValue->value);
self::assertSame(42, $result->genericWithSpecifiedTypeWithIntegerValue->value); // @phpstan-ignore-line
self::assertSame('foo', $result->genericWithSpecifiedTypeWithStringValue->value); // @phpstan-ignore-line
}
}
}
@ -94,7 +94,6 @@ final class GenericObjectWithTwoTemplates
}
/**
* @phpstan-ignore-next-line
* @template T of string|object|42|'foo'
*/
final class GenericObjectWithSpecifiedType

View File

@ -51,11 +51,11 @@ final class ScalarValuesMappingTest extends IntegrationTest
self::assertSame(1337, $result->integerRangeWithPositiveValue);
self::assertSame(-1337, $result->integerRangeWithNegativeValue);
self::assertSame(42, $result->integerRangeWithMinAndMax);
self::assertSame(42, $result->integerValue);
self::assertSame(42, $result->integerValue); // @phpstan-ignore-line
self::assertSame('foo', $result->string);
self::assertSame('bar', $result->nonEmptyString);
self::assertSame('baz', $result->stringValueWithSingleQuote);
self::assertSame('fiz', $result->stringValueWithDoubleQuote);
self::assertSame('baz', $result->stringValueWithSingleQuote); // @phpstan-ignore-line
self::assertSame('fiz', $result->stringValueWithDoubleQuote); // @phpstan-ignore-line
self::assertSame(self::class, $result->classString);
self::assertSame(DateTimeImmutable::class, $result->classStringOfDateTime);
self::assertSame(stdClass::class, $result->classStringOfAlias);

View File

@ -21,7 +21,10 @@ final class AttributesContainerTest extends TestCase
public function test_attributes_are_traversable(): void
{
self::assertIsIterable(new AttributesContainer());
$attributes = [new stdClass(), new stdClass(), new stdClass()];
$container = new AttributesContainer(...$attributes);
self::assertSame($attributes, iterator_to_array($container));
}
public function test_attributes_has_type_checks_all_attributes(): void

View File

@ -146,10 +146,8 @@ final class NodeTest extends TestCase
self::assertNotSame($nodeA, $nodeB);
self::assertTrue($nodeB->isValid());
self::assertSame(
['some message A', 'some message B'],
[(string)$nodeB->messages()[0], (string)$nodeB->messages()[1]]
);
self::assertSame('some message A', (string)$nodeB->messages()[0]);
self::assertSame('some message B', (string)$nodeB->messages()[1]);
}
public function test_node_with_error_message_returns_invalid_node(): void
@ -162,9 +160,7 @@ final class NodeTest extends TestCase
self::assertNotSame($nodeA, $nodeB);
self::assertFalse($nodeB->isValid());
self::assertSame(
[(string)$message, (string)$errorMessage],
[(string)$nodeB->messages()[0], (string)$nodeB->messages()[1]]
);
self::assertSame((string)$message, (string)$nodeB->messages()[0]);
self::assertSame((string)$errorMessage, (string)$nodeB->messages()[1]);
}
}

View File

@ -43,6 +43,6 @@ final class MapperBuilderTest extends TestCase
public function test_mapper_instance_is_the_same(): void
{
self::assertSame($this->mapperBuilder->mapper(), $this->mapperBuilder->mapper()); // @phpstan-ignore-line
self::assertSame($this->mapperBuilder->mapper(), $this->mapperBuilder->mapper());
}
}

View File

@ -14,9 +14,9 @@ final class ArrayKeyTypeTest extends TestCase
{
public function test_instances_are_memoized(): void
{
self::assertSame(ArrayKeyType::default(), ArrayKeyType::default()); // @phpstan-ignore-line
self::assertSame(ArrayKeyType::integer(), ArrayKeyType::integer()); // @phpstan-ignore-line
self::assertSame(ArrayKeyType::string(), ArrayKeyType::string()); // @phpstan-ignore-line
self::assertSame(ArrayKeyType::default(), ArrayKeyType::default());
self::assertSame(ArrayKeyType::integer(), ArrayKeyType::integer());
self::assertSame(ArrayKeyType::string(), ArrayKeyType::string());
}
public function test_string_values_are_correct(): void

View File

@ -34,7 +34,7 @@ final class ArrayTypeTest extends TestCase
public function test_native_returns_same_instance(): void
{
self::assertSame(ArrayType::native(), ArrayType::native()); // @phpstan-ignore-line
self::assertSame(ArrayType::native(), ArrayType::native());
}
public function test_native_subtype_is_correct(): void

View File

@ -32,7 +32,7 @@ final class IterableTypeTest extends TestCase
public function test_native_returns_same_instance(): void
{
self::assertSame(IterableType::native(), IterableType::native()); // @phpstan-ignore-line
self::assertSame(IterableType::native(), IterableType::native());
}
public function test_native_subtype_is_correct(): void

View File

@ -34,7 +34,7 @@ final class ListTypeTest extends TestCase
public function test_native_returns_same_instance(): void
{
self::assertSame(ListType::native(), ListType::native()); // @phpstan-ignore-line
self::assertSame(ListType::native(), ListType::native());
}
public function test_native_subtype_is_correct(): void

View File

@ -33,7 +33,7 @@ final class NonEmptyArrayTypeTest extends TestCase
public function test_native_returns_same_instance(): void
{
self::assertSame(NonEmptyArrayType::native(), NonEmptyArrayType::native()); // @phpstan-ignore-line
self::assertSame(NonEmptyArrayType::native(), NonEmptyArrayType::native());
}
public function test_native_subtype_is_correct(): void

View File

@ -36,7 +36,7 @@ final class NonEmptyListTypeTest extends TestCase
public function test_native_returns_same_instance(): void
{
self::assertSame(NonEmptyListType::native(), NonEmptyListType::native()); // @phpstan-ignore-line
self::assertSame(NonEmptyListType::native(), NonEmptyListType::native());
}
public function test_native_subtype_is_correct(): void