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 | */ |
||
32 | protected $properties = []; |
||
33 | |||
34 | /** |
||
35 | * Construct. |
||
36 | * |
||
37 | * @param string $type |
||
38 | * @param callable|null $callback |
||
39 | */ |
||
40 | 24 | public function __construct(string $type, callable $callback = null) |
|
45 | |||
46 | /** |
||
47 | * {@inheritdoc} |
||
48 | */ |
||
49 | 6 | public function getType(): string |
|
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | 9 | public function invokeMethod(string $name, array $args): InflectorInterface |
|
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | 3 | public function invokeMethods(array $methods): InflectorInterface |
|
75 | |||
76 | /** |
||
77 | * {@inheritdoc} |
||
78 | */ |
||
79 | 6 | public function setProperty(string $property, $value): InflectorInterface |
|
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | 3 | public function setProperties(array $properties): InflectorInterface |
|
97 | |||
98 | /** |
||
99 | * {@inheritdoc} |
||
100 | */ |
||
101 | 12 | public function inflect($object) |
|
120 | } |
||
121 |