Skip to content

Commit

Permalink
Update PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
IonBazan committed Dec 20, 2024
1 parent ee8037c commit b9184cd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
4 changes: 1 addition & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
parameters:
level: 6
level: 7
paths:
- src
excludePaths:
- src/Command/BaseNotTypedCommand.php
checkGenericClassInNonGenericObjectType: true
checkMissingIterableValueType: true
bootstrapFiles:
- src/Command/DiffCommand.php # contains class alias
1 change: 1 addition & 0 deletions src/Formatter/AbstractFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ private function terminalLink($url, $title)
return $title;
}

// @phpstan-ignore function.alreadyNarrowedType
return method_exists('Symfony\Component\Console\Formatter\OutputFormatterStyle', 'setHref') ? sprintf('<href=%s>%s</>', $url, $title) : $title;
}
}
1 change: 1 addition & 0 deletions src/Formatter/JsonFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function renderSingle(DiffEntries $entries, $title, $withUrls)
*/
private function format(array $data)
{
// @phpstan-ignore argument.type
$this->output->writeln(json_encode($data, 128)); // JSON_PRETTY_PRINT
}

Expand Down
1 change: 1 addition & 0 deletions src/PackageDiff.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ private function getFileContents($path)
}

if (filter_var($path, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED) || file_exists($path)) {
// @phpstan-ignore return.type
return file_get_contents($path);
}

Expand Down

0 comments on commit b9184cd

Please sign in to comment.