diff --git a/src/Handler/ContainerHandler.php b/src/Handler/ContainerHandler.php index e750deb..2628c1a 100644 --- a/src/Handler/ContainerHandler.php +++ b/src/Handler/ContainerHandler.php @@ -26,6 +26,7 @@ class ContainerHandler implements AfterMethodCallAnalysisInterface, AfterClassLikeVisitInterface, AfterCodebasePopulatedInterface, BeforeAddIssueInterface { + /** @psalm-suppress MissingClassConstType */ private const GET_CLASSLIKES = [ 'Psr\Container\ContainerInterface', 'Symfony\Component\DependencyInjection\ContainerInterface', diff --git a/src/Test/CodeceptionModule.php b/src/Test/CodeceptionModule.php index 0e58bc2..5c2b46d 100644 --- a/src/Test/CodeceptionModule.php +++ b/src/Test/CodeceptionModule.php @@ -21,27 +21,19 @@ */ class CodeceptionModule extends BaseModule { + /** @psalm-suppress MissingClassConstType */ private const DEFAULT_TWIG_TEMPLATES_DIR = 'templates'; - /** - * @var string - */ - private $twigTemplateDir = self::DEFAULT_TWIG_TEMPLATES_DIR; + private string $twigTemplateDir = self::DEFAULT_TWIG_TEMPLATES_DIR; - /** - * @var FilesystemCache|null - */ - private $twigCache; + private ?FilesystemCache $twigCache = null; - /** - * @var string|null - */ - private $lastCachePath; + private ?string $lastCachePath = null; /** * @var list */ - private $suppressedIssueHandlers = []; + private array $suppressedIssueHandlers = []; public function _initialize(): void { diff --git a/src/Twig/CachedTemplatesMapping.php b/src/Twig/CachedTemplatesMapping.php index c2c21b8..8c1c301 100644 --- a/src/Twig/CachedTemplatesMapping.php +++ b/src/Twig/CachedTemplatesMapping.php @@ -13,6 +13,7 @@ class CachedTemplatesMapping implements AfterCodebasePopulatedInterface { /** + * @psalm-suppress MissingClassConstType * @var string */ public const CACHED_TEMPLATE_HEADER_PATTERN = @@ -20,17 +21,11 @@ class CachedTemplatesMapping implements AfterCodebasePopulatedInterface '\/\* (?@?.+\.twig) \*\/\n'. 'class (?__TwigTemplate_[a-z0-9]{64}) extends (\\\\Twig\\\\)?Template'; - /** - * @var string|null - */ - private static $cachePath; + private static ?string $cachePath = null; - /** - * @var CachedTemplatesRegistry|null - */ - private static $cacheRegistry; + private static ?CachedTemplatesRegistry $cacheRegistry = null; - public static function afterCodebasePopulated(AfterCodebasePopulatedEvent $event) + public static function afterCodebasePopulated(AfterCodebasePopulatedEvent $event): void { $codebase = $event->getCodebase(); diff --git a/src/Twig/TemplateFileAnalyzer.php b/src/Twig/TemplateFileAnalyzer.php index 76b968c..9a2feec 100644 --- a/src/Twig/TemplateFileAnalyzer.php +++ b/src/Twig/TemplateFileAnalyzer.php @@ -35,7 +35,7 @@ public static function initExtensions(array $extensionClasses): void public function analyze( ?PsalmContext $file_context = null, - ?PsalmContext $global_context = null + ?PsalmContext $global_context = null, ): void { $codebase = $this->project_analyzer->getCodebase(); $taint = $codebase->taint_flow_graph; diff --git a/tests/acceptance/acceptance/console/ConsoleArgument.feature b/tests/acceptance/acceptance/console/ConsoleArgument.feature index b4e9631..852abc5 100644 --- a/tests/acceptance/acceptance/console/ConsoleArgument.feature +++ b/tests/acceptance/acceptance/console/ConsoleArgument.feature @@ -2,7 +2,8 @@ Feature: ConsoleArgument Background: - Given I have Symfony plugin enabled + Given I have issue handler "MissingClassConstType" suppressed + And I have Symfony plugin enabled And I have the following code preamble """