@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | public function handle(DomainEvent $event): void |
24 | 24 | { |
25 | - if( |
|
25 | + if ( |
|
26 | 26 | $event instanceof UnitMovedIntoPlay || |
27 | 27 | $event instanceof SpellVanishedToTheVoid |
28 | 28 | ) { |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $this->player = $player; |
14 | 14 | } |
15 | 15 | |
16 | - public static function for(MatchId $match, int $player): self |
|
16 | + public static function for (MatchId $match, int $player): self |
|
17 | 17 | { |
18 | 18 | return new self($match, $player); |
19 | 19 | } |
@@ -48,7 +48,7 @@ |
||
48 | 48 | |
49 | 49 | private static function players(Decks $decks, int ...$ids): array |
50 | 50 | { |
51 | - return array_map(function (int $playerId, int $i) use ($decks): Player { |
|
51 | + return array_map(function(int $playerId, int $i) use ($decks): Player { |
|
52 | 52 | return Player::from($playerId, $decks[$i]->cardsFor($playerId)); |
53 | 53 | }, $ids, array_keys($ids)); |
54 | 54 | } |
@@ -22,35 +22,35 @@ discard block |
||
22 | 22 | |
23 | 23 | public function inHand(): Cards |
24 | 24 | { |
25 | - return $this->filterBy(function (Card $card): bool { |
|
25 | + return $this->filterBy(function(Card $card): bool { |
|
26 | 26 | return $card->isInHand(); |
27 | 27 | }); |
28 | 28 | } |
29 | 29 | |
30 | 30 | public function inPlay(): Cards |
31 | 31 | { |
32 | - return $this->filterBy(function (Card $card): bool { |
|
32 | + return $this->filterBy(function(Card $card): bool { |
|
33 | 33 | return $card->isInPlay(); |
34 | 34 | }); |
35 | 35 | } |
36 | 36 | |
37 | 37 | public function thatAttack(): Cards |
38 | 38 | { |
39 | - return $this->filterBy(function (Card $card): bool { |
|
39 | + return $this->filterBy(function(Card $card): bool { |
|
40 | 40 | return $card->isAttacking(); |
41 | 41 | }); |
42 | 42 | } |
43 | 43 | |
44 | 44 | public function thatDefend(): Cards |
45 | 45 | { |
46 | - return $this->filterBy(function (Card $card): bool { |
|
46 | + return $this->filterBy(function(Card $card): bool { |
|
47 | 47 | return $card->isDefending(); |
48 | 48 | }); |
49 | 49 | } |
50 | 50 | |
51 | 51 | public function inDeck(): Cards |
52 | 52 | { |
53 | - return $this->filterBy(function (Card $card): bool { |
|
53 | + return $this->filterBy(function(Card $card): bool { |
|
54 | 54 | return $card->isInDeck(); |
55 | 55 | }); |
56 | 56 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | public function theOneThatAttacksTheAmbushOf(Card $defender): Card |
64 | 64 | { |
65 | - return $this->filterBy(function (Card $card) use ($defender): bool { |
|
65 | + return $this->filterBy(function(Card $card) use ($defender): bool { |
|
66 | 66 | return $card->isAttackingThe($defender); |
67 | 67 | })[0]; |
68 | 68 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | { |
72 | 72 | return array_reduce( |
73 | 73 | $this->items(), |
74 | - function (?Card $topmost, Card $card): ?Card { |
|
74 | + function(?Card $topmost, Card $card): ?Card { |
|
75 | 75 | if ($topmost === null || $card->hasHigherPositionThan($topmost)) { |
76 | 76 | return $card; |
77 | 77 | } |
@@ -4,6 +4,6 @@ |
||
4 | 4 | |
5 | 5 | interface AllVisitors |
6 | 6 | { |
7 | - public function add(Visitor $visitor): void ; |
|
7 | + public function add(Visitor $visitor): void; |
|
8 | 8 | public function withId(VisitorId $id): ?Visitor; |
9 | 9 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | /** @return MatchProposal[] */ |
26 | - public function for(AccountId $player, DateTimeInterface $currently = null): array |
|
26 | + public function for (AccountId $player, DateTimeInterface $currently = null): array |
|
27 | 27 | { |
28 | 28 | $currently = $currently ?: $this->clock->now(); |
29 | 29 | $proposals = []; |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | { |
19 | 19 | $this->cards[$match->id()] = array_filter( |
20 | 20 | $this->cards[$match->id()], |
21 | - function (Card $card) use ($cardToRemove): bool { |
|
21 | + function(Card $card) use ($cardToRemove): bool { |
|
22 | 22 | return !$card->is($cardToRemove); |
23 | 23 | } |
24 | 24 | ); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | return array_filter( |
37 | 37 | $this->cardsInPlay($match), |
38 | - function (Card $card): bool { |
|
38 | + function(Card $card): bool { |
|
39 | 39 | return $card->isAttacking(); |
40 | 40 | } |
41 | 41 | ); |
@@ -44,14 +44,12 @@ |
||
44 | 44 | public function firstVisitTo(string $page): void |
45 | 45 | { |
46 | 46 | $this->visitorsOnPage[$page] = isset($this->visitorsOnPage[$page]) ? |
47 | - $this->visitorsOnPage[$page] + 1 : |
|
48 | - 1; |
|
47 | + $this->visitorsOnPage[$page] + 1 : 1; |
|
49 | 48 | } |
50 | 49 | |
51 | 50 | public function firstVisitFrom(string $source): void |
52 | 51 | { |
53 | 52 | $this->visitorsFrom[$source] = isset($this->visitorsFrom[$source]) ? |
54 | - $this->visitorsFrom[$source] + 1 : |
|
55 | - 1; |
|
53 | + $this->visitorsFrom[$source] + 1 : 1; |
|
56 | 54 | } |
57 | 55 | } |
@@ -9,7 +9,7 @@ |
||
9 | 9 | private $errorMessages = []; |
10 | 10 | |
11 | 11 | /** @return string[] */ |
12 | - public function for(CorrelationId $theRequest): array |
|
12 | + public function for (CorrelationId $theRequest): array |
|
13 | 13 | { |
14 | 14 | // return ['Cannot open account for unknown entity']; |
15 | 15 | return $this->errorMessages[$theRequest->id()] ?? []; |