File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 11<?php
22namespace ScriptFUSION \Mapper \Strategy ;
33
4- use ScriptFUSION \Mapper \MapperAware ;
5- use ScriptFUSION \Mapper \MapperAwareTrait ;
64use ScriptFUSION \Mapper \Mapping ;
75
86/**
97 * Walks a nested structure to the specified element in the same manner as Copy.
108 */
11- class Walk extends Copy implements MapperAware
9+ class Walk extends Delegate
1210{
13- use MapperAwareTrait;
14-
15- private $ expression ;
11+ /**
12+ * @var Copy
13+ */
14+ private $ copy ;
1615
1716 /**
1817 * @param Strategy|Mapping|array|mixed $expression Expression.
1918 * @param array|string $path Array of path components or string of `->`-delimited components.
2019 */
2120 public function __construct ($ expression , $ path )
2221 {
23- parent ::__construct ($ path );
22+ parent ::__construct ($ expression );
2423
25- $ this ->expression = $ expression ;
24+ $ this ->copy = new Copy ( $ path ) ;
2625 }
2726
2827 public function __invoke ($ data , $ context = null )
2928 {
30- return parent :: __invoke ($ this ->getMapper ()-> map ( $ data , $ this -> expression , $ context ), $ context );
29+ return call_user_func ($ this ->copy , parent :: __invoke ( $ data , $ context ), $ context );
3130 }
3231}
You can’t perform that action at this time.
0 commit comments