1 | <?php |
||
13 | abstract class Dialogue |
||
14 | { |
||
15 | /** |
||
16 | * @var MenuStyle |
||
17 | */ |
||
18 | protected $style; |
||
19 | |||
20 | /** |
||
21 | * @var CliMenu |
||
22 | */ |
||
23 | protected $parentMenu; |
||
24 | |||
25 | /** |
||
26 | * @var Terminal |
||
27 | */ |
||
28 | protected $terminal; |
||
29 | |||
30 | /** |
||
31 | * @var string $text |
||
32 | */ |
||
33 | protected $text; |
||
34 | |||
35 | /** |
||
36 | * @var int |
||
37 | */ |
||
38 | protected $x; |
||
39 | |||
40 | /** |
||
41 | * @var int |
||
42 | */ |
||
43 | protected $y; |
||
44 | |||
45 | public function __construct(CliMenu $parentMenu, MenuStyle $menuStyle, Terminal $terminal, string $text) |
||
54 | |||
55 | /** |
||
56 | * @throws MenuNotOpenException |
||
57 | */ |
||
58 | protected function assertMenuOpen() : void |
||
64 | |||
65 | /** |
||
66 | * Calculate the co-ordinates to write the messages |
||
67 | */ |
||
68 | protected function calculateCoordinates() : void |
||
80 | |||
81 | /** |
||
82 | * Write an empty row |
||
83 | */ |
||
84 | protected function emptyRow() : void |
||
97 | |||
98 | /** |
||
99 | * Write some text at a particular column |
||
100 | */ |
||
101 | protected function write(string $text, int $column = null) : void |
||
106 | |||
107 | public function getStyle() : MenuStyle |
||
111 | } |
||
112 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.