@@ -24,7 +24,7 @@ |
||
| 24 | 24 | | will extract all "Illuminate\Console\Command" based class commands. |
| 25 | 25 | | |
| 26 | 26 | */ |
| 27 | - 'paths' => [app_path('Commands')], |
|
| 27 | + 'paths' => [ app_path('Commands') ], |
|
| 28 | 28 | |
| 29 | 29 | /* |
| 30 | 30 | |-------------------------------------------------------------------------- |
@@ -42,12 +42,12 @@ discard block |
||
| 42 | 42 | { |
| 43 | 43 | return [ |
| 44 | 44 | $abbr, |
| 45 | - $score['pointQ1'], |
|
| 46 | - $score['pointQ2'], |
|
| 47 | - $score['pointQ3'], |
|
| 48 | - $score['pointQ4'], |
|
| 49 | - $score['pointOT'], |
|
| 50 | - $score['pointTotal'], |
|
| 45 | + $score[ 'pointQ1' ], |
|
| 46 | + $score[ 'pointQ2' ], |
|
| 47 | + $score[ 'pointQ3' ], |
|
| 48 | + $score[ 'pointQ4' ], |
|
| 49 | + $score[ 'pointOT' ], |
|
| 50 | + $score[ 'pointTotal' ], |
|
| 51 | 51 | ]; |
| 52 | 52 | } |
| 53 | 53 | |
@@ -64,10 +64,10 @@ discard block |
||
| 64 | 64 | $this->printScoreBoardHeader($game); |
| 65 | 65 | |
| 66 | 66 | $this->command->table( |
| 67 | - ['', '1', '2', '3', '4', 'OT', 'T'], |
|
| 67 | + [ '', '1', '2', '3', '4', 'OT', 'T' ], |
|
| 68 | 68 | [ |
| 69 | - $this->buildScoreBoardRow($game->gameSchedule['homeTeamAbbr'], $game->score['homeTeamScore']), |
|
| 70 | - $this->buildScoreBoardRow($game->gameSchedule['visitorTeamAbbr'], $game->score['visitorTeamScore']), |
|
| 69 | + $this->buildScoreBoardRow($game->gameSchedule[ 'homeTeamAbbr' ], $game->score[ 'homeTeamScore' ]), |
|
| 70 | + $this->buildScoreBoardRow($game->gameSchedule[ 'visitorTeamAbbr' ], $game->score[ 'visitorTeamScore' ]), |
|
| 71 | 71 | ] |
| 72 | 72 | ); |
| 73 | 73 | |
@@ -86,9 +86,9 @@ discard block |
||
| 86 | 86 | $this->command->line( |
| 87 | 87 | sprintf( |
| 88 | 88 | '%s VS %s @ %s', |
| 89 | - $game->gameSchedule['homeTeamAbbr'], |
|
| 90 | - $game->gameSchedule['visitorTeamAbbr'], |
|
| 91 | - $game->gameSchedule['site']['siteFullname'] |
|
| 89 | + $game->gameSchedule[ 'homeTeamAbbr' ], |
|
| 90 | + $game->gameSchedule[ 'visitorTeamAbbr' ], |
|
| 91 | + $game->gameSchedule[ 'site' ][ 'siteFullname' ] |
|
| 92 | 92 | ) |
| 93 | 93 | ); |
| 94 | 94 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $this->command->line(sprintf( |
| 97 | 97 | '%s | %s | %s %s', |
| 98 | 98 | $game->getCurrentQuarter(), |
| 99 | - $game->score['time'], |
|
| 99 | + $game->score[ 'time' ], |
|
| 100 | 100 | $game->getPossesionTeam(), |
| 101 | 101 | $game->getCurrentDown() |
| 102 | 102 | )); |
@@ -112,19 +112,19 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | public function renderGamesList(?GenericList $gameCollection): void |
| 114 | 114 | { |
| 115 | - $data = []; |
|
| 115 | + $data = [ ]; |
|
| 116 | 116 | |
| 117 | - $gameCollection->forEach(function ($game, $key) use (&$data) { |
|
| 117 | + $gameCollection->forEach(function($game, $key) use (&$data) { |
|
| 118 | 118 | array_push($data, [ |
| 119 | - $game->gameSchedule['homeTeamAbbr'], |
|
| 120 | - $game->gameSchedule['visitorTeamAbbr'], |
|
| 121 | - $game->gameSchedule['site']['siteFullname'], |
|
| 122 | - $game->gameSchedule['gameDate'], |
|
| 123 | - sprintf('%s ET', $game->gameSchedule['gameTimeEastern']), |
|
| 119 | + $game->gameSchedule[ 'homeTeamAbbr' ], |
|
| 120 | + $game->gameSchedule[ 'visitorTeamAbbr' ], |
|
| 121 | + $game->gameSchedule[ 'site' ][ 'siteFullname' ], |
|
| 122 | + $game->gameSchedule[ 'gameDate' ], |
|
| 123 | + sprintf('%s ET', $game->gameSchedule[ 'gameTimeEastern' ]), |
|
| 124 | 124 | ]); |
| 125 | 125 | }); |
| 126 | 126 | |
| 127 | - $this->command->table(['Home', 'Visitor', 'Stadium', 'Date', 'Hour'], $data); |
|
| 127 | + $this->command->table([ 'Home', 'Visitor', 'Stadium', 'Date', 'Hour' ], $data); |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | exit($this->command->line('Sorry, there is no games right now.')); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - $games->forEach(function ($game, $key) { |
|
| 144 | + $games->forEach(function($game, $key) { |
|
| 145 | 145 | $this->printScoreBoard($game); |
| 146 | 146 | }); |
| 147 | 147 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | public function __get(string $name) |
| 41 | 41 | { |
| 42 | 42 | if (array_key_exists($name, $this->data)) { |
| 43 | - return $this->data[$name]; |
|
| 43 | + return $this->data[ $name ]; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | throw new NonExistingPropertyException(sprintf('There is not property called %s in this object', $name)); |
@@ -54,15 +54,15 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function getCurrentDown(): ?string |
| 56 | 56 | { |
| 57 | - if ($this->score['down'] === 0) { |
|
| 57 | + if ($this->score[ 'down' ] === 0) { |
|
| 58 | 58 | return null; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | return sprintf( |
| 62 | 62 | '%d%s & %d', |
| 63 | - $this->score['down'], |
|
| 64 | - getOrdinalSuffix($this->score['down']), |
|
| 65 | - $this->score['yardsToGo'] |
|
| 63 | + $this->score[ 'down' ], |
|
| 64 | + getOrdinalSuffix($this->score[ 'down' ]), |
|
| 65 | + $this->score[ 'yardsToGo' ] |
|
| 66 | 66 | ); |
| 67 | 67 | } |
| 68 | 68 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function getPossesionTeam(): ?string |
| 77 | 77 | { |
| 78 | - return !$this->isFinished() ? $this->score['possessionTeamAbbr'] : null; |
|
| 78 | + return !$this->isFinished() ? $this->score[ 'possessionTeamAbbr' ] : null; |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | public function getCurrentQuarter(): ?string |
| 88 | 88 | { |
| 89 | - return $this->score['phaseDescription']; |
|
| 89 | + return $this->score[ 'phaseDescription' ]; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | public function isFinished(): bool |
| 99 | 99 | { |
| 100 | - return in_array($this->score['phase'], ['FINAL', 'FINAL OVERTIME']); |
|
| 100 | + return in_array($this->score[ 'phase' ], [ 'FINAL', 'FINAL OVERTIME' ]); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
@@ -108,6 +108,6 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | public function isSuspended(): bool |
| 110 | 110 | { |
| 111 | - return $this->score['phase'] === 'SUSPENDED'; |
|
| 111 | + return $this->score[ 'phase' ] === 'SUSPENDED'; |
|
| 112 | 112 | } |
| 113 | 113 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | public function register(): void |
| 17 | 17 | { |
| 18 | - $this->app->bind(NFL::class, function () { |
|
| 18 | + $this->app->bind(NFL::class, function() { |
|
| 19 | 19 | return new NFL(new NFLHttpClient(), new DateTime('now', new DateTimeZone('US/Eastern'))); |
| 20 | 20 | }); |
| 21 | 21 | } |
@@ -55,8 +55,8 @@ discard block |
||
| 55 | 55 | return null; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - return $todayGames->filter(function ($key, $game) { |
|
| 59 | - return in_array($game->score['phase'], ['FINAL', 'FINAL OVERTIME']); |
|
| 58 | + return $todayGames->filter(function($key, $game) { |
|
| 59 | + return in_array($game->score[ 'phase' ], [ 'FINAL', 'FINAL OVERTIME' ]); |
|
| 60 | 60 | }); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -77,9 +77,9 @@ discard block |
||
| 77 | 77 | return null; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - return $finishedGames->filter(function ($key, $game) use ($team) { |
|
| 81 | - return $game->gameSchedule['homeTeamAbbr'] === $team || |
|
| 82 | - $game->gameSchedule['visitorTeamAbbr'] === $team; |
|
| 80 | + return $finishedGames->filter(function($key, $game) use ($team) { |
|
| 81 | + return $game->gameSchedule[ 'homeTeamAbbr' ] === $team || |
|
| 82 | + $game->gameSchedule[ 'visitorTeamAbbr' ] === $team; |
|
| 83 | 83 | }); |
| 84 | 84 | } |
| 85 | 85 | |
@@ -99,8 +99,8 @@ discard block |
||
| 99 | 99 | return null; |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - return $todayGames->filter(function ($key, $game) { |
|
| 103 | - return !in_array($game->score['phase'], ['FINAL', 'SUSPENDED', 'FINAL OVERTIME', null]); |
|
| 102 | + return $todayGames->filter(function($key, $game) { |
|
| 103 | + return !in_array($game->score[ 'phase' ], [ 'FINAL', 'SUSPENDED', 'FINAL OVERTIME', null ]); |
|
| 104 | 104 | }); |
| 105 | 105 | } |
| 106 | 106 | |
@@ -121,9 +121,9 @@ discard block |
||
| 121 | 121 | return null; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - return $livegames->filter(function ($key, $game) use ($team) { |
|
| 125 | - return $game->gameSchedule['homeTeamAbbr'] === $team || |
|
| 126 | - $game->gameSchedule['visitorTeamAbbr'] === $team; |
|
| 124 | + return $livegames->filter(function($key, $game) use ($team) { |
|
| 125 | + return $game->gameSchedule[ 'homeTeamAbbr' ] === $team || |
|
| 126 | + $game->gameSchedule[ 'visitorTeamAbbr' ] === $team; |
|
| 127 | 127 | }); |
| 128 | 128 | } |
| 129 | 129 | |
@@ -135,8 +135,8 @@ discard block |
||
| 135 | 135 | */ |
| 136 | 136 | public function getTodayGames(): ?GenericList |
| 137 | 137 | { |
| 138 | - return $this->getWeekGames()->filter(function ($key, $game) { |
|
| 139 | - return str_replace('\/', '/', $game->gameSchedule['gameDate']) === $this->today->format('m/d/Y'); |
|
| 138 | + return $this->getWeekGames()->filter(function($key, $game) { |
|
| 139 | + return str_replace('\/', '/', $game->gameSchedule[ 'gameDate' ]) === $this->today->format('m/d/Y'); |
|
| 140 | 140 | }); |
| 141 | 141 | } |
| 142 | 142 | |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $data = $this->client->get(); |
| 157 | 157 | $parsedData = JSONParser::parse($data); |
| 158 | 158 | |
| 159 | - foreach ($parsedData['gameScores'] as $key => $gameData) { |
|
| 159 | + foreach ($parsedData[ 'gameScores' ] as $key => $gameData) { |
|
| 160 | 160 | $games->add(new Game($gameData)); |
| 161 | 161 | } |
| 162 | 162 | |