mirror of
https://github.com/danog/Valinor.git
synced 2024-12-02 17:48:14 +01:00
a97b406154
Will recursively flatten messages of a node and all its children. This helper can for instance be used when errors occurred during a mapping to flatten all caught errors into a basic array of string that can then easily be used to inform the user of what is wrong. ``` try { // … } catch(MappingError $error) { $messages = (new MessagesFlattener($error->node()))->errors(); foreach ($messages as $message) { echo $message; } } ``` |
||
---|---|---|
.. | ||
Object | ||
Source | ||
Tree | ||
MappingErrorTest.php | ||
TreeMapperContainerTest.php |