Skip to content

Commit

Permalink
Test against PHP 8.3 (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
seferov authored Dec 21, 2024
1 parent fb801a9 commit f0ade25
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 29 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
php-version:
- 8.1
- 8.2
- 8.3

dependencies:
- highest
Expand Down Expand Up @@ -66,6 +67,7 @@ jobs:
php-version:
- 8.1
- 8.2
- 8.3

symfony-version:
- 6
Expand Down
35 changes: 30 additions & 5 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.13.1@086b94371304750d1c673315321a55d15fc59015">
<files psalm-version="5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0">
<file src="src/Handler/ContainerHandler.php">
<MissingClassConstType>
<code><![CDATA[GET_CLASSLIKES = [
'Psr\Container\ContainerInterface',
'Symfony\Component\DependencyInjection\ContainerInterface',
'Symfony\Component\DependencyInjection\Container',
'Symfony\Bundle\FrameworkBundle\Controller\AbstractController',
'Symfony\Bundle\FrameworkBundle\Controller\ControllerTrait',
'Symfony\Bundle\FrameworkBundle\Test\TestContainer',
]]]></code>
</MissingClassConstType>
</file>
<file src="src/Plugin.php">
<UnusedPsalmSuppress occurrences="1">
<code>DeprecatedMethod</code>
<UnusedPsalmSuppress>
<code><![CDATA[DeprecatedMethod]]></code>
</UnusedPsalmSuppress>
</file>
<file src="src/Test/CodeceptionModule.php">
<MissingClassConstType>
<code><![CDATA[DEFAULT_TWIG_TEMPLATES_DIR = 'templates']]></code>
</MissingClassConstType>
</file>
<file src="src/Twig/CachedTemplatesMapping.php">
<MissingClassConstType>
<code><![CDATA[CACHED_TEMPLATE_HEADER_PATTERN =
'use Twig\\\\Template;\n\n'.
'\/\* (?<name>@?.+\.twig) \*\/\n'.
'class (?<class>__TwigTemplate_[a-z0-9]{64}) extends (\\\\Twig\\\\)?Template']]></code>
</MissingClassConstType>
</file>
<file src="src/Twig/Context.php">
<UnnecessaryVarAnnotation>
<code>int</code>
<code>string</code>
<code><![CDATA[int]]></code>
<code><![CDATA[string]]></code>
</UnnecessaryVarAnnotation>
</file>
</files>
17 changes: 4 additions & 13 deletions src/Test/CodeceptionModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,16 @@ class CodeceptionModule extends BaseModule
{
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<string>
*/
private $suppressedIssueHandlers = [];
private array $suppressedIssueHandlers = [];

public function _initialize(): void
{
Expand Down
12 changes: 3 additions & 9 deletions src/Twig/CachedTemplatesMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,11 @@ class CachedTemplatesMapping implements AfterCodebasePopulatedInterface
'\/\* (?<name>@?.+\.twig) \*\/\n'.
'class (?<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();

Expand Down
2 changes: 1 addition & 1 deletion src/Twig/TemplateFileAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion tests/acceptance/acceptance/console/ConsoleArgument.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
Feature: ConsoleArgument

Background:
Given I have Symfony plugin enabled
Given I have issue handler "UnusedVariable,MissingClassConstType" suppressed
And I have Symfony plugin enabled
And I have the following code preamble
"""
<?php
Expand Down

0 comments on commit f0ade25

Please sign in to comment.