We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f657d8f commit 0003fdaCopy full SHA for 0003fda
src/Presenter.php
@@ -77,8 +77,12 @@ public function process(array $data) : array
77
$key = $value;
78
}
79
80
- if (is_array($value) && count($value) == 2) {
81
- $presenter = new $value[1](get_from_array($data, $value[0]));
+ if (is_array($value) && count($value) == 1) {
+ $class = array_keys($value)[0];
82
+ $params = $value[$class];
83
+ $arrData = $params[0] ?? '.';
84
+ $transformer = $params[1] ?? null;
85
+ $presenter = new $class(get_from_array($data, $arrData), $transformer);
86
$newVal = $value;
87
if ($presenter instanceof Presenter) {
88
$newVal = $presenter->handle();
0 commit comments