@@ -15,7 +15,7 @@ |
||
15 | 15 | */ |
16 | 16 | public function register(): void |
17 | 17 | { |
18 | - $this->app->bind(NFL::class, function ($app) { |
|
18 | + $this->app->bind(NFL::class, function($app) { |
|
19 | 19 | return new NFL(new NFLHttpClient(), new DateTime('now', new DateTimeZone('US/Eastern'))); |
20 | 20 | }); |
21 | 21 | } |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function getFinishedGames(): ?GenericList |
51 | 51 | { |
52 | - return $this->getTodayGames()->filter(function ($key, $game) { |
|
53 | - return in_array($game->score['phase'], ['FINAL', 'FINAL OVERTIME']); |
|
52 | + return $this->getTodayGames()->filter(function($key, $game) { |
|
53 | + return in_array($game->score[ 'phase' ], [ 'FINAL', 'FINAL OVERTIME' ]); |
|
54 | 54 | }); |
55 | 55 | } |
56 | 56 | |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function getFinishedGameByTeam(string $team): ?GenericList |
67 | 67 | { |
68 | - return $this->getFinishedGames()->filter(function ($key, $game) use ($team) { |
|
69 | - return $game->gameSchedule['homeTeamAbbr'] === $team || |
|
70 | - $game->gameSchedule['visitorTeamAbbr'] === $team; |
|
68 | + return $this->getFinishedGames()->filter(function($key, $game) use ($team) { |
|
69 | + return $game->gameSchedule[ 'homeTeamAbbr' ] === $team || |
|
70 | + $game->gameSchedule[ 'visitorTeamAbbr' ] === $team; |
|
71 | 71 | }); |
72 | 72 | } |
73 | 73 | |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function getLiveGames(): ?GenericList |
83 | 83 | { |
84 | - return $this->getWeekGames()->filter(function ($key, $game) { |
|
85 | - return !in_array($game->score['phase'], ['FINAL', 'SUSPENDED', 'FINAL OVERTIME', null]); |
|
84 | + return $this->getWeekGames()->filter(function($key, $game) { |
|
85 | + return !in_array($game->score[ 'phase' ], [ 'FINAL', 'SUSPENDED', 'FINAL OVERTIME', null ]); |
|
86 | 86 | }); |
87 | 87 | } |
88 | 88 | |
@@ -97,9 +97,9 @@ discard block |
||
97 | 97 | */ |
98 | 98 | public function getLiveGameByTeam(string $team): ?GenericList |
99 | 99 | { |
100 | - return $this->getLiveGames()->filter(function ($key, $game) use ($team) { |
|
101 | - return $game->gameSchedule['homeTeamAbbr'] === $team || |
|
102 | - $game->gameSchedule['visitorTeamAbbr'] === $team; |
|
100 | + return $this->getLiveGames()->filter(function($key, $game) use ($team) { |
|
101 | + return $game->gameSchedule[ 'homeTeamAbbr' ] === $team || |
|
102 | + $game->gameSchedule[ 'visitorTeamAbbr' ] === $team; |
|
103 | 103 | }); |
104 | 104 | } |
105 | 105 | |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function getTodayGames(): ?GenericList |
113 | 113 | { |
114 | - return $this->getWeekGames()->filter(function ($key, $game) { |
|
115 | - return str_replace('\/', '/', $game->gameSchedule['gameDate']) === $this->today->format('m/d/Y'); |
|
114 | + return $this->getWeekGames()->filter(function($key, $game) { |
|
115 | + return str_replace('\/', '/', $game->gameSchedule[ 'gameDate' ]) === $this->today->format('m/d/Y'); |
|
116 | 116 | }); |
117 | 117 | } |
118 | 118 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $data = $this->client->get(); |
133 | 133 | $parsedData = JSONParser::parse($data); |
134 | 134 | |
135 | - foreach ($parsedData['gameScores'] as $key => $gameData) { |
|
135 | + foreach ($parsedData[ 'gameScores' ] as $key => $gameData) { |
|
136 | 136 | $games->add(new Game($gameData)); |
137 | 137 | } |
138 | 138 |