Valinor/tests/Unit
Romain Canon f232cc0636 feat!: introduce constructor for custom date formats
A new constructor can be registered to declare which format(s) are
supported during the mapping of a date object. By default, any valid
timestamp or ATOM-formatted value will be accepted.

```php
(new \CuyZ\Valinor\MapperBuilder())
    // Both COOKIE and ATOM formats will be accepted
    ->registerConstructor(
        new \CuyZ\Valinor\Mapper\Object\DateTimeFormatConstructor(DATE_COOKIE, DATE_ATOM)
    )
    ->mapper()
    ->map(DateTimeInterface::class, 'Monday, 08-Nov-1971 13:37:42 UTC');
```

The previously very opinionated behaviour has been removed, but can be
temporarily used to help with the migration.

```php
(new \CuyZ\Valinor\MapperBuilder())
    ->registerConstructor(
        new \CuyZ\Valinor\Mapper\Object\BackwardCompatibilityDateTimeConstructor()
    )
    ->mapper()
    ->map(DateTimeInterface::class, 'Monday, 08-Nov-1971 13:37:42 UTC');
```
2022-09-01 12:24:24 +02:00
..
Cache fix: prevent illegal characters in PSR-16 cache keys 2022-08-31 01:01:16 +02:00
Definition misc: fetch attributes for function definition 2022-08-29 23:09:15 +02:00
Mapper feat!: introduce constructor for custom date formats 2022-09-01 12:24:24 +02:00
Type misc: add singleton usage of ClassStringType 2022-08-29 23:09:15 +02:00
Utility misc: refactor arguments instantiation 2022-08-29 23:09:15 +02:00
MapperBuilderTest.php test: add missing test assertion 2022-08-31 01:01:16 +02:00