Skip to content

Commit

Permalink
chore(inspector): combine declaration check
Browse files Browse the repository at this point in the history
  • Loading branch information
imdhemy committed Mar 23, 2024
1 parent 1c2d079 commit dbceac7
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,11 @@ public function inspect(): void
}

$declares = $this->stmt->declares;
if (! isset($declares[0])) {
if (! isset($declares[0]) || ! $declares[0] instanceof DeclareItem) {
throw InspectionError::warning(self::MESSAGE);
}

$declaration = $declares[0];
if (! $declaration instanceof DeclareItem) {
throw InspectionError::warning(self::MESSAGE);
}

if ('strict_types' !== $declaration->key->name) {
throw InspectionError::warning(self::MESSAGE);
}
Expand Down

0 comments on commit dbceac7

Please sign in to comment.