1 | <?php declare(strict_types=1); |
||
9 | class Inflector implements ArgumentResolverInterface, InflectorInterface |
||
10 | { |
||
11 | use ArgumentResolverTrait; |
||
12 | use ContainerAwareTrait; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $type; |
||
18 | |||
19 | /** |
||
20 | * @var callable |
||
21 | */ |
||
22 | protected $callback; |
||
23 | |||
24 | /** |
||
25 | * @var array |
||
26 | */ |
||
27 | protected $methods = []; |
||
28 | |||
29 | /** |
||
30 | * @var array |
||
31 | 6 | */ |
|
32 | protected $properties = []; |
||
33 | 6 | ||
34 | /** |
||
35 | 6 | * Construct. |
|
36 | * |
||
37 | * @param string $type |
||
38 | * @param callable|null $callback |
||
39 | */ |
||
40 | public function __construct(string $type, callable $callback = null) |
||
45 | |||
46 | 3 | /** |
|
47 | 3 | * {@inheritdoc} |
|
48 | 2 | */ |
|
49 | public function getType(): string |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | public function invokeMethod(string $name, array $args): InflectorInterface |
||
63 | |||
64 | 9 | /** |
|
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | public function invokeMethods(array $methods): InflectorInterface |
||
75 | 3 | ||
76 | 3 | /** |
|
77 | 2 | * {@inheritdoc} |
|
78 | */ |
||
79 | 3 | public function setProperty(string $property, $value): InflectorInterface |
|
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | 9 | */ |
|
89 | public function setProperties(array $properties): InflectorInterface |
||
97 | 9 | ||
98 | 3 | /** |
|
99 | * {@inheritdoc} |
||
100 | 3 | */ |
|
101 | 6 | public function inflect($object) |
|
120 | } |
||
121 |