Valinor/tests
Romain Canon 1b0ff39af6 feat!: handle exhaustive list of interface inferring
It is now mandatory to list all possible class-types that can be
inferred by the mapper. This change is a step towards the library being
able to deliver powerful new features such as compiling a mapper for
better performance.

BREAKING CHANGE: the existing calls to `MapperBuilder::infer` that could
return several class-names must now add a signature to the callback. The
callbacks that require no parameter and always return the same
class-name can remain unchanged.

For instance:

```php
$builder = (new \CuyZ\Valinor\MapperBuilder())
    // Can remain unchanged
    ->infer(SomeInterface::class, fn () => SomeImplementation::class);
```

```php
$builder = (new \CuyZ\Valinor\MapperBuilder())
    ->infer(
        SomeInterface::class,
        fn (string $type) => match($type) {
            'first' => ImplementationA::class,
            'second' => ImplementationB::class,
            default => throw new DomainException("Unhandled `$type`.")
        }
    )
    // …should be modified with:
    ->infer(
        SomeInterface::class,
        /** @return class-string<ImplementationA|ImplementationB> */
        fn (string $type) => match($type) {
            'first' => ImplementationA::class,
            'second' => ImplementationB::class,
            default => throw new DomainException("Unhandled `$type`.")
        }
    );
```
2022-06-17 18:03:27 +02:00
..
Fake feat: introduce method to warm the cache up 2022-05-23 22:01:40 +02:00
Fixture fix: allow declaring promoted parameter type with @var annotation 2022-05-26 17:35:33 +02:00
Functional feat: extract file watching feature in own cache implementation 2022-05-23 20:28:02 +02:00
Integration feat!: handle exhaustive list of interface inferring 2022-06-17 18:03:27 +02:00
StaticAnalysis test: configure vimeo/psalm to verify type inference 2022-01-13 19:55:20 +01:00
Traits feat: initial release 2021-11-28 18:21:56 +01:00
Unit fix: allow declaring promoted parameter type with @var annotation 2022-05-26 17:35:33 +02:00