Valinor/tests
Romain Canon 6d427088f7 feat!: improve object binding API
The method `MapperBuilder::bind()` can be used to define a custom way to
build an object during the mapping.

The return type of the callback will be resolved by the mapping to know
when to use it.

The callback can take any arguments, that will automatically be mapped
using the given source. These arguments can then be used to instantiate
the object in the desired way.

Example:

```php
(new \CuyZ\Valinor\MapperBuilder())
    ->bind(function(string $string, OtherClass $otherClass): SomeClass {
        $someClass = new SomeClass($string);
        $someClass->addOtherClass($otherClass);

        return $someClass;
    })
    ->mapper()
    ->map(SomeClass::class, [
        // …
    ]);
```
2022-02-19 19:58:28 +01:00
..
Fake refactor: regroup object inferring strategies 2022-02-19 19:58:28 +01:00
Fixture fix: handle nested attributes compilation 2021-12-27 20:57:38 +01:00
Functional feat: introduce function definition repository 2022-02-19 19:58:28 +01:00
Integration feat!: improve object binding API 2022-02-19 19:58:28 +01: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 feat!: improve object binding API 2022-02-19 19:58:28 +01:00