Total Complexity | 4 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
18 | class CustomModule extends AbstractCustomExtension |
||
19 | { |
||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $camelCaseMachineName; |
||
24 | |||
25 | /** |
||
26 | * {@inheritdoc} |
||
27 | */ |
||
28 | 4 | public function __construct(string $rootPath, string $machineName) |
|
29 | { |
||
30 | 4 | parent::__construct($rootPath, $machineName); |
|
31 | |||
32 | // The same camelize function is used in the Drupal kernel. |
||
33 | 4 | $this->camelCaseMachineName = ContainerBuilder::camelize($machineName); |
|
34 | 4 | } |
|
35 | |||
36 | /** |
||
37 | * @return string |
||
38 | */ |
||
39 | 1 | public function getCamelCaseMachineName(): string |
|
40 | { |
||
41 | 1 | return $this->camelCaseMachineName; |
|
42 | } |
||
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | */ |
||
47 | 1 | public function serialize(): ?string |
|
48 | { |
||
49 | 1 | return \serialize(array( |
|
50 | 1 | $this->rootPath, |
|
51 | 1 | $this->machineName, |
|
52 | 1 | $this->camelCaseMachineName, |
|
53 | )); |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | 1 | public function unserialize($serialized): void |
|
62 | 1 | } |
|
63 | } |
||
64 |