Valinor/tests/Integration/Mapping/Object
Romain Canon ecafba3b21 feat!: introduce method to register constructors used during mapping
It is now mandatory to explicitly register custom constructors —
including named constructors — that can be used by the mapper. The
former automatic registration of named constructor feature doesn't
work anymore.

BREAKING CHANGE: existing code must list all named constructors that
were previously automatically used by the mapper, and registerer them
using the method `MapperBuilder::registerConstructor()`.

The method `MapperBuilder::bind()` has been deprecated, the method above
should be used instead.

```php
final class SomeClass
{
    public static function namedConstructor(string $foo): self
    {
        // …
    }
}

(new \CuyZ\Valinor\MapperBuilder())
    ->registerConstructor(
        SomeClass::namedConstructor(...),
        // …or for PHP < 8.1:
        [SomeClass::class, 'namedConstructor'],
    )
    ->mapper()
    ->map(SomeClass::class, [
        // …
    ]);
```
2022-03-24 13:03:55 +01:00
..
ArrayValuesMappingTest.php feat!: wrap node messages in proper class 2022-01-06 14:11:42 +01:00
DateTimeMappingTest.php test: strengthen datetime mapping tests 2022-03-03 13:02:01 +01:00
EnumValuesMappingTest.php feat!: allow mapping to any type 2022-01-02 00:48:01 +01:00
GenericValuesMappingTest.php feat!: allow mapping to any type 2022-01-02 00:48:01 +01:00
IterableValuesMappingTest.php feat!: allow mapping to any type 2022-01-02 00:48:01 +01:00
ListValuesMappingTest.php feat!: wrap node messages in proper class 2022-01-06 14:11:42 +01:00
LocalTypeAliasMappingTest.php feat!: allow mapping to any type 2022-01-02 00:48:01 +01:00
ObjectValuesMappingTest.php misc!: allow object builder to yield arguments without source 2022-01-07 13:41:15 +01:00
ScalarValuesMappingTest.php feat!: wrap node messages in proper class 2022-01-06 14:11:42 +01:00
ShapedArrayValuesMappingTest.php qa: require and include phpstan/phpstan-phpunit rules 2022-02-19 19:58:28 +01:00
UnionOfObjectsMappingTest.php feat!: introduce method to register constructors used during mapping 2022-03-24 13:03:55 +01:00
UnionValuesMappingTest.php feat!: allow mapping to any type 2022-01-02 00:48:01 +01:00