Total Complexity | 5 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
21 | abstract class Slot |
||
22 | { |
||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $name; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $label; |
||
32 | |||
33 | /** |
||
34 | * @param string $name |
||
35 | * @param string $label |
||
36 | * |
||
37 | * @throws WrongFormatException |
||
38 | */ |
||
39 | public function __construct($name, $label) |
||
40 | { |
||
41 | if (!preg_match('/[a-z]+[a-z0-9-_]*/i', $name)) { |
||
42 | throw WrongFormatException::slotNameWrongFormat($name); |
||
43 | } |
||
44 | |||
45 | $this->name = $name; |
||
46 | $this->label = $label; |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * @return string |
||
51 | */ |
||
52 | public function getName() |
||
53 | { |
||
54 | return $this->name; |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * @return string |
||
59 | */ |
||
60 | public function getLabel() |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * @return string |
||
67 | */ |
||
68 | abstract public function getFlexFormConfiguration(); |
||
69 | } |
||
70 |