@@ -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 | ) { |
@@ -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 | } |
@@ -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 = []; |
@@ -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 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | } |
27 | 27 | |
28 | 28 | |
29 | - public static function for( |
|
29 | + public static function for ( |
|
30 | 30 | MatchId $match, |
31 | 31 | int $player, |
32 | 32 | CorrelationId $correlationId |
@@ -51,7 +51,7 @@ |
||
51 | 51 | |
52 | 52 | private static function players(Decks $decks, int ...$ids): array |
53 | 53 | { |
54 | - return array_map(function (int $playerId, int $i) use ($decks): Player { |
|
54 | + return array_map(function(int $playerId, int $i) use ($decks): Player { |
|
55 | 55 | return Player::from($playerId, $decks[$i]->cards()); |
56 | 56 | }, $ids, array_keys($ids)); |
57 | 57 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | { |
20 | 20 | $this->cards[$match->id()][$owner] = array_filter( |
21 | 21 | $this->cards[$match->id()][$owner], |
22 | - function (Card $card) use ($cardToRemove): bool { |
|
22 | + function(Card $card) use ($cardToRemove): bool { |
|
23 | 23 | return !$card->is($cardToRemove); |
24 | 24 | } |
25 | 25 | ); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | { |
43 | 43 | return array_filter( |
44 | 44 | $this->cardsInPlay($match), |
45 | - function (Card $card): bool { |
|
45 | + function(Card $card): bool { |
|
46 | 46 | return $card->isAttacking(); |
47 | 47 | } |
48 | 48 | ); |
@@ -9,7 +9,7 @@ |
||
9 | 9 | private $errorMessages = []; |
10 | 10 | |
11 | 11 | /** @return string[] */ |
12 | - public function for(CorrelationId $request): array |
|
12 | + public function for (CorrelationId $request): array |
|
13 | 13 | { |
14 | 14 | // return ['Cannot open account for unknown entity']; |
15 | 15 | return $this->errorMessages[$request->id()] ?? []; |