File tree 1 file changed +8
-9
lines changed
1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
namespace ScriptFUSION \Mapper \Strategy ;
3
3
4
- use ScriptFUSION \Mapper \MapperAware ;
5
- use ScriptFUSION \Mapper \MapperAwareTrait ;
6
4
use ScriptFUSION \Mapper \Mapping ;
7
5
8
6
/**
9
7
* Walks a nested structure to the specified element in the same manner as Copy.
10
8
*/
11
- class Walk extends Copy implements MapperAware
9
+ class Walk extends Delegate
12
10
{
13
- use MapperAwareTrait;
14
-
15
- private $ expression ;
11
+ /**
12
+ * @var Copy
13
+ */
14
+ private $ copy ;
16
15
17
16
/**
18
17
* @param Strategy|Mapping|array|mixed $expression Expression.
19
18
* @param array|string $path Array of path components or string of `->`-delimited components.
20
19
*/
21
20
public function __construct ($ expression , $ path )
22
21
{
23
- parent ::__construct ($ path );
22
+ parent ::__construct ($ expression );
24
23
25
- $ this ->expression = $ expression ;
24
+ $ this ->copy = new Copy ( $ path ) ;
26
25
}
27
26
28
27
public function __invoke ($ data , $ context = null )
29
28
{
30
- return parent :: __invoke ($ this ->getMapper ()-> map ( $ data , $ this -> expression , $ context ), $ context );
29
+ return call_user_func ($ this ->copy , parent :: __invoke ( $ data , $ context ), $ context );
31
30
}
32
31
}
You can’t perform that action at this time.
0 commit comments