Skip to content

Commit

Permalink
Merge pull request #1013 from cakephp/3.x-update-stan
Browse files Browse the repository at this point in the history
update stan
  • Loading branch information
ADmad authored Nov 17, 2024
2 parents ccb0c78 + 5b61eb4 commit 9ea800f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpstan" version="1.11.9" installed="1.11.9" location="./tools/phpstan" copy="false"/>
<phar name="psalm" version="5.25.0" installed="5.25.0" location="./tools/psalm" copy="false"/>
<phar name="phpstan" version="2.0.1" installed="2.0.1" location="./tools/phpstan" copy="false"/>
<phar name="psalm" version="5.26.1" installed="5.26.1" location="./tools/psalm" copy="false"/>
</phive>
12 changes: 10 additions & 2 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
parameters:
ignoreErrors:
-
message: "#^Instanceof between mixed and Cake\\\\Chronos\\\\Chronos will always evaluate to false\\.$#"
message: '#^Method Bake\\BakePlugin\:\:bootstrap\(\) has parameter \$app with generic interface Cake\\Core\\PluginApplicationInterface but does not specify its types\: TSubject$#'
identifier: missingType.generics
count: 1
path: src/BakePlugin.php

-
message: '#^Instanceof between mixed and Cake\\Chronos\\Chronos will always evaluate to false\.$#'
identifier: instanceof.alwaysFalse
count: 1
path: src/Command/FixtureCommand.php

-
message: "#^Dead catch \\- UnexpectedValueException is never thrown in the try block\\.$#"
message: '#^Dead catch \- UnexpectedValueException is never thrown in the try block\.$#'
identifier: catch.neverThrown
count: 1
path: src/Command/TestCommand.php
7 changes: 2 additions & 5 deletions src/BakePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class BakePlugin extends BasePlugin
/**
* Load the TwigView plugin.
*
* @phpstan-ignore-next-line
* @param \Cake\Core\PluginApplicationInterface $app The host application
* @return void
*/
Expand Down Expand Up @@ -138,22 +137,20 @@ protected function findInPath(string $namespace, string $path): array
if ($item->isDot() || $item->isDir()) {
continue;
}
/** @psalm-var class-string<\Bake\Command\BakeCommand> $class */
$class = $namespace . $item->getBasename('.php');

if (!$hasSubfolder) {
try {
$reflection = new ReflectionClass($class);
/** @phpstan-ignore-next-line */
} catch (ReflectionException $e) {
} catch (ReflectionException) {
continue;
}
/** @psalm-suppress TypeDoesNotContainType */
if (!$reflection->isInstantiable() || !$reflection->isSubclassOf(BakeCommand::class)) {
continue;
}
}

/** @var class-string<\Bake\Command\BakeCommand> $class */
$candidates[$class::defaultName()] = $class;
}

Expand Down

0 comments on commit 9ea800f

Please sign in to comment.