Skip to content

Commit

Permalink
test: Fixes for PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
xiCO2k committed May 27, 2022
1 parent 4e68381 commit f7c12c6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/Commands/GamesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class GamesCommand extends Command
{
protected $signature = 'games';

public function handle(Scores $scores)
public function handle(Scores $scores): void
{
live(fn () => view('games', [
'sports' => $scores->getScores(),
Expand Down
9 changes: 7 additions & 2 deletions app/Scores.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

use App\Apis\BasketballApi;
use App\Apis\FootballApi;
use App\Contracts\ScoresApi;
use Illuminate\Support\Collection;

class Scores
{
/**
* List of supported Sports
* List of supported Sports.
*
* @var string[]
*/
Expand All @@ -18,13 +20,16 @@ class Scores
];

/**
* Gets the Scores from the multiple sports available.
*
* @return array<string, Collection>
*/
public function getScores()
public function getScores(): array
{
$data = [];

foreach (self::$sportsAvailable as $sport => $class) {
/** @var ScoresApi $class */
$data[$sport] = (new $class())->fetch();
}

Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ includes:
- phpstan-baseline.neon

parameters:
level: 8
level: 5
paths:
- app
- config
Expand Down

0 comments on commit f7c12c6

Please sign in to comment.