1 | <?php |
||
17 | abstract class AbstractBuilder |
||
18 | { |
||
19 | /** |
||
20 | * @var int|string |
||
21 | */ |
||
22 | protected $name; |
||
23 | |||
24 | /** |
||
25 | * @var string|null |
||
26 | */ |
||
27 | protected $nodeId; |
||
28 | |||
29 | /** |
||
30 | * @var string|null |
||
31 | */ |
||
32 | protected $defaultId; |
||
33 | |||
34 | /** |
||
35 | * @var int|int[]|string|string[] |
||
36 | */ |
||
37 | protected $children; |
||
38 | |||
39 | /** |
||
40 | * Rule constructor. |
||
41 | * @param string|int $name Rule name. |
||
42 | * @param int|int[]|string|string[] $children Children. |
||
43 | * @param string $nodeId Node ID. |
||
44 | */ |
||
45 | public function __construct($name, $children, string $nodeId = null) |
||
51 | |||
52 | /** |
||
53 | * @param $name |
||
54 | */ |
||
55 | public function setName($name): void |
||
59 | |||
60 | /** |
||
61 | * @return Rule |
||
62 | */ |
||
63 | abstract public function build(): Rule; |
||
64 | |||
65 | /** |
||
66 | * @param $nodeId |
||
67 | */ |
||
68 | public function setNodeId($nodeId): void |
||
72 | |||
73 | /** |
||
74 | * @param $defaultNodeId |
||
75 | */ |
||
76 | public function setDefaultId($defaultNodeId): void |
||
80 | } |
||
81 |