Total Complexity | 5 |
Total Lines | 56 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
16 | class Namespaces extends PluginConfigAnnotation |
||
17 | { |
||
18 | /** |
||
19 | * Set custom namespace, |
||
20 | * for example: |
||
21 | * |
||
22 | * billing/invoices |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | public $namespace; |
||
27 | |||
28 | /** |
||
29 | * Name to use as alias for this operation. |
||
30 | * |
||
31 | * By default the same operation name is used, |
||
32 | * but removing any suffix containing the node name, |
||
33 | * example `AddPost` when is namespaced is converted to `add` |
||
34 | * inside `posts` namespace. If you wat to use for example `create` instead |
||
35 | * can set this as alias. |
||
36 | * |
||
37 | * @var bool |
||
38 | */ |
||
39 | public $alias; |
||
40 | |||
41 | /** |
||
42 | * @var bool |
||
43 | */ |
||
44 | public $enabled; |
||
45 | |||
46 | /** |
||
47 | * @var string |
||
48 | */ |
||
49 | public $node; |
||
50 | |||
51 | /** |
||
52 | * @var string |
||
53 | */ |
||
54 | public $bundle; |
||
55 | |||
56 | public function __construct(array $config = []) |
||
57 | { |
||
58 | if (isset($config['value']) && \count($config) === 1 && \is_bool($config['value'])) { |
||
59 | $config['enabled'] = $config['value']; |
||
60 | unset($config['value']); |
||
61 | } |
||
62 | parent::__construct($config); |
||
63 | } |
||
64 | |||
65 | |||
66 | /** |
||
67 | * {@inheritdoc} |
||
68 | */ |
||
69 | public function getName(): string |
||
72 | } |
||
73 | } |
||
74 |