1 | <?php |
||
12 | class Table extends BaseTable |
||
13 | { |
||
14 | /** |
||
15 | * @var Uuid |
||
16 | */ |
||
17 | private $id; |
||
18 | |||
19 | /** |
||
20 | * @var Dealer |
||
21 | */ |
||
22 | private $dealer; |
||
23 | |||
24 | /** |
||
25 | * @var PlayerCollection |
||
26 | */ |
||
27 | private $players; |
||
28 | |||
29 | /** |
||
30 | * @var PlayerCollection |
||
31 | */ |
||
32 | private $playersSatOut; |
||
33 | |||
34 | /** |
||
35 | * @var int |
||
36 | */ |
||
37 | private $button = 0; |
||
38 | |||
39 | /** |
||
40 | * Table constructor. |
||
41 | * |
||
42 | 66 | * @param Uuid $id |
|
43 | * @param DealerContract $dealer |
||
44 | 66 | * @param PlayerCollection $players |
|
45 | 66 | */ |
|
46 | 66 | private function __construct(Uuid $id, DealerContract $dealer, PlayerCollection $players) |
|
53 | |||
54 | /** |
||
55 | 66 | * @param Uuid $id |
|
56 | * @param DealerContract $dealer |
||
57 | 66 | * @param PlayerCollection $players |
|
58 | * |
||
59 | * @return Table |
||
60 | */ |
||
61 | public static function setUp(Uuid $id, DealerContract $dealer, PlayerCollection $players) |
||
65 | 64 | ||
66 | /** |
||
67 | * @return Uuid |
||
68 | */ |
||
69 | public function id(): Uuid |
||
73 | 52 | ||
74 | /** |
||
75 | * @return PlayerCollection |
||
76 | */ |
||
77 | public function players(): PlayerCollection |
||
81 | 46 | ||
82 | /** |
||
83 | * @return DealerContract |
||
84 | */ |
||
85 | public function dealer(): DealerContract |
||
89 | 12 | ||
90 | /** |
||
91 | * @return int |
||
92 | */ |
||
93 | public function button(): int |
||
97 | 9 | ||
98 | 9 | /** |
|
99 | * @return PlayerContract |
||
100 | */ |
||
101 | public function locatePlayerWithButton(): PlayerContract |
||
105 | 61 | ||
106 | /** |
||
107 | * @param PlayerContract $player |
||
108 | */ |
||
109 | public function sitPlayerOut(PlayerContract $player) |
||
113 | 3 | ||
114 | /** |
||
115 | 3 | * @return PlayerCollection |
|
116 | 3 | */ |
|
117 | 3 | public function playersSatDown(): PlayerCollection |
|
121 | 3 | ||
122 | 1 | /** |
|
123 | * @param PlayerContract $player |
||
124 | * |
||
125 | 2 | * @throws TableException |
|
126 | 2 | */ |
|
127 | public function giveButtonToPlayer(PlayerContract $player) |
||
141 | |||
142 | /** |
||
143 | 22 | * Moves the button along the table seats. |
|
144 | */ |
||
145 | 22 | public function moveButton() |
|
153 | |||
154 | 22 | /** |
|
155 | * @param PlayerContract $findPlayer |
||
156 | * |
||
157 | 22 | * @return int |
|
158 | 22 | */ |
|
159 | public function findSeat(PlayerContract $findPlayer): int |
||
168 | |||
169 | /** |
||
170 | * @param string $playerName |
||
171 | * |
||
172 | * @return Player |
||
173 | 16 | */ |
|
174 | public function findPlayerByName($playerName): PlayerContract |
||
182 | } |
||
183 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.