1 | <?php declare(strict_types=1); |
||
23 | class DecoratorSpecBuilder implements DecoratorSpecBuilderInterface |
||
24 | { |
||
25 | private $regexp = '/ |
||
26 | ^ |
||
27 | \@(?<name>[a-z_]+(?:[\w-]*\w)?) |
||
28 | \s* |
||
29 | (?: |
||
30 | \( |
||
31 | \s* |
||
32 | (?<params> |
||
33 | ( |
||
34 | (?:[^\'\"\(\)\,\s]+) # literal |
||
35 | | |
||
36 | (?:[+-]?[0-9]+\.?[0-9]*) # numbers (no exponential notation) |
||
37 | | |
||
38 | (?:\'[^\']*\') # single-quoted string |
||
39 | | |
||
40 | (?:\"[^\"]*\") # double-quoted string |
||
41 | | |
||
42 | (?:\[\s*\]) # empty array |
||
43 | | |
||
44 | (?:\{\s*\}) # empty object |
||
45 | | |
||
46 | true | false | null |
||
47 | )(?:\s*\,\s*((?-3))*)* |
||
48 | )? |
||
49 | \s* |
||
50 | \) |
||
51 | )? |
||
52 | \s* |
||
53 | $ |
||
54 | /xi'; |
||
55 | /** |
||
56 | * @var ArgumentValueBuilderInterface |
||
57 | */ |
||
58 | private $argument; |
||
59 | |||
60 | /** |
||
61 | * @param ArgumentValueBuilderInterface $argument |
||
62 | */ |
||
63 | 4 | public function __construct(ArgumentValueBuilderInterface $argument) |
|
67 | |||
68 | /** |
||
69 | * {@inheritdoc} |
||
70 | */ |
||
71 | 4 | public function build(string $definition): DecoratorSpecInterface |
|
94 | |||
95 | /** |
||
96 | * @param string $name |
||
97 | * @param array $raw_args |
||
98 | * |
||
99 | * @return DecoratorSpecInterface |
||
100 | */ |
||
101 | 3 | protected function buildDecorator(string $name, array $raw_args): DecoratorSpecInterface |
|
110 | } |
||
111 |