1 | <?php |
||
11 | class Transform implements Processor |
||
12 | { |
||
13 | use Processor\Implementation; |
||
14 | |||
15 | /** |
||
16 | * Default transformation functions |
||
17 | * @var array |
||
18 | */ |
||
19 | public static $defaultFunctions = [ |
||
20 | 'hash' => 'hash', |
||
21 | 'base64_encode' => 'base64_encode', |
||
22 | 'base64_decode' => 'base64_decode', |
||
23 | 'json_encode' => 'json_encode', |
||
24 | 'json_decode' => 'json_decode', |
||
25 | 'serialize' => 'serialize', |
||
26 | 'unserialize' => 'unserialize', |
||
27 | 'strtotime' => 'strtotime', |
||
28 | 'date' => 'date' |
||
29 | ]; |
||
30 | |||
31 | /** |
||
32 | * Allowed transformation functions |
||
33 | * @var array |
||
34 | */ |
||
35 | public $functions; |
||
36 | |||
37 | |||
38 | /** |
||
39 | * Class constructor |
||
40 | * |
||
41 | * @param string $property Property key with the processing instruction |
||
42 | */ |
||
43 | 6 | public function __construct($property) |
|
48 | |||
49 | /** |
||
50 | * Apply processing to a single node |
||
51 | * |
||
52 | * @param Node $node |
||
53 | */ |
||
54 | 3 | public function applyToNode(Node $node) |
|
82 | } |
||
83 |