mirror of
https://github.com/danog/Valinor.git
synced 2024-12-02 09:37:46 +01:00
doc: remove duplicated section
This commit is contained in:
parent
b794c692c4
commit
7044801119
30
README.md
30
README.md
@ -707,36 +707,6 @@ final class SecondImplementation implements SomeInterface
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Modifiers
|
|
||||||
|
|
||||||
Sometimes the source is not in the same format and/or organised in the same
|
|
||||||
way as a value object. Modifiers can be used to change a source before the
|
|
||||||
mapping occurs.
|
|
||||||
|
|
||||||
#### Camel case keys
|
|
||||||
|
|
||||||
This modifier recursively forces all keys to be in camelCase format.
|
|
||||||
|
|
||||||
```php
|
|
||||||
final class SomeClass
|
|
||||||
{
|
|
||||||
public readonly string $someValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$source = new \CuyZ\Valinor\Mapper\Source\Modifier\CamelCaseKeys([
|
|
||||||
'some_value' => 'foo',
|
|
||||||
// …or…
|
|
||||||
'some-value' => 'foo',
|
|
||||||
// …or…
|
|
||||||
'some value' => 'foo',
|
|
||||||
// …will be replaced by `['someValue' => 'foo']`
|
|
||||||
]);
|
|
||||||
|
|
||||||
(new \CuyZ\Valinor\MapperBuilder())
|
|
||||||
->mapper()
|
|
||||||
->map(SomeClass::class, $source);
|
|
||||||
```
|
|
||||||
|
|
||||||
## Handled types
|
## Handled types
|
||||||
|
|
||||||
To prevent conflicts or duplication of the type annotations, this library tries
|
To prevent conflicts or duplication of the type annotations, this library tries
|
||||||
|
Loading…
Reference in New Issue
Block a user