Skip to content

Commit

Permalink
Fixed Psalm errors (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbyoung authored Jan 19, 2024
1 parent 7d03723 commit faa7486
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Users/SqlUserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function getUserById(int $id): User
$statement->execute(['id' => $id]);
$row = $statement->fetch(PDO::FETCH_ASSOC);

if (empty($row)) {
if ($row === false || \count($row) === 0) {
throw new UserNotFoundException("No user found with ID $id");
}

Expand Down
3 changes: 2 additions & 1 deletion tests/Integration/IntegrationTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ protected function setUp(): void
parent::setUp();

// Auto-call certain trait methods if the test case uses them
$traits = \class_uses($this) ?: [];
$traits = \class_uses($this);
$traits = $traits === false ? [] : $traits;

if (isset($traits[MigratesDatabase::class])) {
/** @psalm-suppress UndefinedMethod This method will exist because it uses the migration trait */
Expand Down

0 comments on commit faa7486

Please sign in to comment.