1 | <?php |
||
17 | abstract class Builder |
||
18 | { |
||
19 | /** |
||
20 | * @var null|string |
||
21 | */ |
||
22 | protected $name; |
||
23 | |||
24 | /** |
||
25 | * @var int |
||
26 | */ |
||
27 | protected $id; |
||
28 | |||
29 | /** |
||
30 | * @var array|int[] |
||
31 | */ |
||
32 | protected $children = []; |
||
33 | |||
34 | /** |
||
35 | * Builder constructor. |
||
36 | * @param int $id |
||
37 | * @param null|string $name |
||
38 | */ |
||
39 | public function __construct(int $id, string $name = null) |
||
44 | |||
45 | /** |
||
46 | * @param int $rule |
||
47 | * @return Builder |
||
48 | */ |
||
49 | public function jump(int $rule): Builder |
||
55 | |||
56 | /** |
||
57 | * @param null|string $name |
||
58 | * @return Builder |
||
59 | */ |
||
60 | public function rename(?string $name): Builder |
||
66 | |||
67 | /** |
||
68 | * @return null|string |
||
69 | */ |
||
70 | public function getName(): ?string |
||
74 | |||
75 | /** |
||
76 | * @return int |
||
77 | */ |
||
78 | public function getId(): int |
||
82 | |||
83 | /** |
||
84 | * @return Symbol |
||
85 | */ |
||
86 | abstract public function build(): Symbol; |
||
87 | |||
88 | /** |
||
89 | * @return string |
||
90 | */ |
||
91 | public function __toString(): string |
||
95 | } |
||
96 |