From 08850f42ceb907c9c8197701ba47e4e4d03a1a5f Mon Sep 17 00:00:00 2001 From: Georgy Oganisyan Date: Sat, 23 May 2026 00:04:43 +0300 Subject: [PATCH 1/5] Bumped pollyfill for symfony/property-info to 7.1.8 --- src/RestClientBuilder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/RestClientBuilder.php b/src/RestClientBuilder.php index 309488c..9ecd6b2 100644 --- a/src/RestClientBuilder.php +++ b/src/RestClientBuilder.php @@ -98,12 +98,12 @@ public static function create(PsrHttpClient $client, ?string $apiKey = null, ?st $typeExtractors = []; /* @infection-ignore-all */ - if (isOldPackage('symfony/property-info', '6.1')) { + if (isOldPackage('symfony/property-info', '7.1.8')) { $typeExtractors[] = new PollyfillPhpStanExtractor(); } /* @infection-ignore-all */ - if (!isOldPackage('symfony/property-info', '6.1')) { + if (!isOldPackage('symfony/property-info', '7.1.8')) { $typeExtractors[] = new PhpStanExtractor(); } From 62778dbee93fb8c73b8b57e3da620c0f52422fc6 Mon Sep 17 00:00:00 2001 From: Georgy Oganisyan Date: Sat, 23 May 2026 01:24:02 +0300 Subject: [PATCH 2/5] Fixed compatibility with PhpStan 2.0 --- .../Extractor/PollyfillPhpStanExtractor.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Infrastructure/PropertyInfo/Extractor/PollyfillPhpStanExtractor.php b/src/Infrastructure/PropertyInfo/Extractor/PollyfillPhpStanExtractor.php index 7b7533a..2e485b3 100644 --- a/src/Infrastructure/PropertyInfo/Extractor/PollyfillPhpStanExtractor.php +++ b/src/Infrastructure/PropertyInfo/Extractor/PollyfillPhpStanExtractor.php @@ -23,6 +23,7 @@ use PHPStan\PhpDocParser\Parser\PhpDocParser; use PHPStan\PhpDocParser\Parser\TokenIterator; use PHPStan\PhpDocParser\Parser\TypeParser; +use PHPStan\PhpDocParser\ParserConfig; use Symfony\Component\PropertyInfo\Extractor\ConstructorArgumentTypeExtractorInterface; use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor; use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface; @@ -77,8 +78,18 @@ public function __construct(?array $mutatorPrefixes = null, ?array $accessorPref $this->accessorPrefixes = $accessorPrefixes ?? ReflectionExtractor::$defaultAccessorPrefixes; $this->arrayMutatorPrefixes = $arrayMutatorPrefixes ?? ReflectionExtractor::$defaultArrayMutatorPrefixes; - $this->phpDocParser = new PhpDocParser(new TypeParser(new ConstExprParser()), new ConstExprParser()); - $this->lexer = new Lexer(); + if (class_exists(ParserConfig::class)) { //PhpStan 2.0 + $config = new ParserConfig([]); + $this->lexer = new Lexer($config); + $this->phpDocParser = new PhpDocParser( + $config, + new TypeParser($config, new ConstExprParser($config)), + new ConstExprParser($config) + ); + } else { + $this->lexer = new Lexer(); + $this->phpDocParser = new PhpDocParser(new TypeParser(new ConstExprParser()), new ConstExprParser()); + } $this->nameScopeFactory = new NameScopeFactory(); } From ddc0958ce46cf8b5b60b715ea95a640f208d64d2 Mon Sep 17 00:00:00 2001 From: Georgy Oganisyan Date: Sat, 23 May 2026 01:24:40 +0300 Subject: [PATCH 3/5] Fixed compatibility with PhpStan 2.0 --- .../PropertyInfo/Extractor/PollyfillPhpStanExtractor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Infrastructure/PropertyInfo/Extractor/PollyfillPhpStanExtractor.php b/src/Infrastructure/PropertyInfo/Extractor/PollyfillPhpStanExtractor.php index 2e485b3..2c2cda5 100644 --- a/src/Infrastructure/PropertyInfo/Extractor/PollyfillPhpStanExtractor.php +++ b/src/Infrastructure/PropertyInfo/Extractor/PollyfillPhpStanExtractor.php @@ -78,7 +78,7 @@ public function __construct(?array $mutatorPrefixes = null, ?array $accessorPref $this->accessorPrefixes = $accessorPrefixes ?? ReflectionExtractor::$defaultAccessorPrefixes; $this->arrayMutatorPrefixes = $arrayMutatorPrefixes ?? ReflectionExtractor::$defaultArrayMutatorPrefixes; - if (class_exists(ParserConfig::class)) { //PhpStan 2.0 + if (class_exists(ParserConfig::class)) { // PhpStan 2.0 $config = new ParserConfig([]); $this->lexer = new Lexer($config); $this->phpDocParser = new PhpDocParser( From 38fbcb3ab0e35939db7337c589fb9963e17b0720 Mon Sep 17 00:00:00 2001 From: Georgy Oganisyan Date: Mon, 25 May 2026 18:38:26 +0300 Subject: [PATCH 4/5] Fixed compatibility with PhpStan 2.0 --- src/RestClientBuilder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/RestClientBuilder.php b/src/RestClientBuilder.php index 9ecd6b2..12a6b92 100644 --- a/src/RestClientBuilder.php +++ b/src/RestClientBuilder.php @@ -98,12 +98,12 @@ public static function create(PsrHttpClient $client, ?string $apiKey = null, ?st $typeExtractors = []; /* @infection-ignore-all */ - if (isOldPackage('symfony/property-info', '7.1.8')) { + if (isOldPackage('symfony/property-info', '7.1.7')) { $typeExtractors[] = new PollyfillPhpStanExtractor(); } /* @infection-ignore-all */ - if (!isOldPackage('symfony/property-info', '7.1.8')) { + if (!isOldPackage('symfony/property-info', '7.1.7')) { $typeExtractors[] = new PhpStanExtractor(); } From ce6595c20647ae21c5e0171aa2ad8f922d49d67c Mon Sep 17 00:00:00 2001 From: Georgy Oganisyan Date: Mon, 25 May 2026 18:40:25 +0300 Subject: [PATCH 5/5] Fixed compatibility with PhpStan 2.0 --- src/RestClientBuilder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/RestClientBuilder.php b/src/RestClientBuilder.php index 12a6b92..9ecd6b2 100644 --- a/src/RestClientBuilder.php +++ b/src/RestClientBuilder.php @@ -98,12 +98,12 @@ public static function create(PsrHttpClient $client, ?string $apiKey = null, ?st $typeExtractors = []; /* @infection-ignore-all */ - if (isOldPackage('symfony/property-info', '7.1.7')) { + if (isOldPackage('symfony/property-info', '7.1.8')) { $typeExtractors[] = new PollyfillPhpStanExtractor(); } /* @infection-ignore-all */ - if (!isOldPackage('symfony/property-info', '7.1.7')) { + if (!isOldPackage('symfony/property-info', '7.1.8')) { $typeExtractors[] = new PhpStanExtractor(); }