Valinor/tests/Fake
Romain Canon ad1207153e feat!: rework messages body and parameters features
The `\CuyZ\Valinor\Mapper\Tree\Message\Message` interface is no longer
a `Stringable`, however it defines a new method `body` that must return
the body of the message, which can contain placeholders that will be
replaced by parameters.

These parameters can now be defined by implementing the interface
`\CuyZ\Valinor\Mapper\Tree\Message\HasParameters`.

This leads to the deprecation of the no longer needed interface
`\CuyZ\Valinor\Mapper\Tree\Message\TranslatableMessage` which had a
confusing name.

```php
final class SomeException
    extends DomainException
    implements ErrorMessage, HasParameters, HasCode
{
    private string $someParameter;

    public function __construct(string $someParameter)
    {
        parent::__construct();

        $this->someParameter = $someParameter;
    }

    public function body() : string
    {
        return 'Some message / {some_parameter} / {source_value}';
    }

    public function parameters(): array
    {
        return [
            'some_parameter' => $this->someParameter,
        ];
    }

    public function code() : string
    {
        // A unique code that can help to identify the error
        return 'some_unique_code';
    }
}
```
2022-07-25 22:05:31 +02:00
..
Cache feat: introduce method to warm the cache up 2022-05-23 22:01:40 +02:00
Definition fix: handle function definition cache invalidation when file is modified 2022-04-06 18:24:16 +02:00
Mapper feat!: rework messages body and parameters features 2022-07-25 22:05:31 +02:00
Type misc: remove types stringable behavior 2022-07-13 21:44:07 +02:00
FakeReflector.php feat: initial release 2021-11-28 18:21:56 +01:00