Skip to content

Commit

Permalink
fix phpstan and update phpstan-baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
gennadigennadigennadi committed Dec 15, 2024
1 parent 909ac84 commit 5755254
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
35 changes: 35 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,10 +1,35 @@
parameters:
ignoreErrors:
-
message: "#^Property Qossmic\\\\Deptrac\\\\Contract\\\\Analyser\\\\EventHelper\\:\\:\\$unmatchedSkippedViolation \\(array\\<string, list\\<string\\>\\>\\) does not accept array\\<string, array\\<int\\<0, max\\>, string\\>\\>\\.$#"
count: 1
path: src/Contract/Analyser/EventHelper.php

-
message: "#^Method Qossmic\\\\Deptrac\\\\Contract\\\\Result\\\\OutputResult\\:\\:allOf\\(\\) should return list\\<T of Qossmic\\\\Deptrac\\\\Contract\\\\Result\\\\RuleInterface\\> but returns list\\<Qossmic\\\\Deptrac\\\\Contract\\\\Result\\\\RuleInterface\\>\\.$#"
count: 1
path: src/Contract/Result/OutputResult.php

-
message: "#^Method Qossmic\\\\Deptrac\\\\Core\\\\Analyser\\\\TokenInLayerAnalyser\\:\\:__construct\\(\\) throws checked exception TypeError but it's missing from the PHPDoc @throws tag\\.$#"
count: 1
path: src/Core/Analyser/TokenInLayerAnalyser.php

-
message: "#^Method Qossmic\\\\Deptrac\\\\Core\\\\Analyser\\\\TokenInLayerAnalyser\\:\\:__construct\\(\\) throws checked exception ValueError but it's missing from the PHPDoc @throws tag\\.$#"
count: 1
path: src/Core/Analyser/TokenInLayerAnalyser.php

-
message: "#^Method Qossmic\\\\Deptrac\\\\Core\\\\Analyser\\\\UnassignedTokenAnalyser\\:\\:__construct\\(\\) throws checked exception TypeError but it's missing from the PHPDoc @throws tag\\.$#"
count: 1
path: src/Core/Analyser/UnassignedTokenAnalyser.php

-
message: "#^Method Qossmic\\\\Deptrac\\\\Core\\\\Analyser\\\\UnassignedTokenAnalyser\\:\\:__construct\\(\\) throws checked exception ValueError but it's missing from the PHPDoc @throws tag\\.$#"
count: 1
path: src/Core/Analyser/UnassignedTokenAnalyser.php

-
message: "#^Method Qossmic\\\\Deptrac\\\\Core\\\\Ast\\\\AstMap\\\\ReferenceBuilder\\:\\:superglobal\\(\\) throws checked exception TypeError but it's missing from the PHPDoc @throws tag\\.$#"
count: 1
Expand All @@ -15,6 +40,11 @@ parameters:
count: 1
path: src/Core/Ast/AstMap/ReferenceBuilder.php

-
message: "#^Property Qossmic\\\\Deptrac\\\\Core\\\\Ast\\\\AstMap\\\\ReferenceBuilder\\:\\:\\$tokenTemplates \\(list\\<string\\>\\) does not accept array\\<int\\<0, max\\>, string\\>\\.$#"
count: 1
path: src/Core/Ast/AstMap/ReferenceBuilder.php

-
message: "#^Method Qossmic\\\\Deptrac\\\\Supportive\\\\Console\\\\Command\\\\DebugTokenCommand\\:\\:execute\\(\\) throws checked exception TypeError but it's missing from the PHPDoc @throws tag\\.$#"
count: 1
Expand All @@ -24,3 +54,8 @@ parameters:
message: "#^Method Qossmic\\\\Deptrac\\\\Supportive\\\\Console\\\\Command\\\\DebugTokenCommand\\:\\:execute\\(\\) throws checked exception ValueError but it's missing from the PHPDoc @throws tag\\.$#"
count: 1
path: src/Supportive/Console/Command/DebugTokenCommand.php

-
message: "#^Possibly impure instantiation of class Qossmic\\\\Deptrac\\\\Supportive\\\\Time\\\\Period in pure method Qossmic\\\\Deptrac\\\\Supportive\\\\Time\\\\Period\\:\\:stop\\(\\)\\.$#"
count: 1
path: src/Supportive/Time/Period.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ private static function loadCache(ContainerBuilder $container, SplFileInfo $cach
private static function loadConfiguration(ContainerBuilder $container, SplFileInfo $configFile): void
{
$configPathInfo = $configFile->getPathInfo();
/** @phpstan-ignore-next-line false positive */

if (null === $configPathInfo) {
throw CannotLoadConfiguration::fromConfig($configFile->getFilename(), 'Unable to load config: Invalid or missing path.');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function output(Graph $graph, OutputInterface $output, OutputFormatter

$imageFile = new SplFileInfo($dumpImagePath);
$imagePathInfo = $imageFile->getPathInfo();
/** @phpstan-ignore-next-line false positive */

if (null === $imagePathInfo) {
throw OutputException::withMessage('Unable to dump image: Invalid or missing path.');
}
Expand Down

0 comments on commit 5755254

Please sign in to comment.