Bug Report
| Subject |
Details |
| Rector version |
latest dev-main |
Rector is producing this error:
{
"totals": {
"changed_files": 0,
"errors": 1
},
"errors": [
{
"message": "System error: \"Rector\\PHPStanStaticTypeMapper\\PHPStanStaticTypeMapper::mapToPHPStanPhpDocTypeNode for PHPStan\\Type\\ConditionalType\"\nRun Rector with \"--debug\" option and post the report here: https://github.com/rectorphp/rector/issues/new",
"file": "/var/www/src/../storage/demo/nhiokqbj8b3in8kegccs/rector_analyzed_file.php",
"line": 36
}
]
}
Minimal PHP Code Causing Issue
The error happens with the following phpdoc (from class ParameterBag in Symfony DependencyInjection):
<?php
namespace Symfony\Component\DependencyInjection\ParameterBag;
class ParameterBag
{
/**
* @template TValue of array<array|scalar>|scalar
*
* @param TValue $value
*
* @return (TValue is scalar ? array|scalar : array<array|scalar>)
*/
public function resolveValue(mixed $value, array $resolving = []): mixed
{
return '';
}
}
The problem happens with DowngradeLevelSetList::DOWN_TO_PHP_74:
https://getrector.com/demo/ccaae362-0585-4dfe-8136-02bd85684fc2
And it does not happen with DowngradeLevelSetList::DOWN_TO_PHP_80:
https://getrector.com/demo/a5718e52-8605-42c9-ac2a-2cc29fb9c870
I also checked in PHPStan, and it seems to work well there:
https://phpstan.org/r/718555a5-2550-4001-86e8-e55f5ee43670
Bug Report
Rector is producing this error:
{ "totals": { "changed_files": 0, "errors": 1 }, "errors": [ { "message": "System error: \"Rector\\PHPStanStaticTypeMapper\\PHPStanStaticTypeMapper::mapToPHPStanPhpDocTypeNode for PHPStan\\Type\\ConditionalType\"\nRun Rector with \"--debug\" option and post the report here: https://github.com/rectorphp/rector/issues/new", "file": "/var/www/src/../storage/demo/nhiokqbj8b3in8kegccs/rector_analyzed_file.php", "line": 36 } ] }Minimal PHP Code Causing Issue
The error happens with the following phpdoc (from class
ParameterBagin Symfony DependencyInjection):The problem happens with
DowngradeLevelSetList::DOWN_TO_PHP_74:https://getrector.com/demo/ccaae362-0585-4dfe-8136-02bd85684fc2
And it does not happen with
DowngradeLevelSetList::DOWN_TO_PHP_80:https://getrector.com/demo/a5718e52-8605-42c9-ac2a-2cc29fb9c870
I also checked in PHPStan, and it seems to work well there:
https://phpstan.org/r/718555a5-2550-4001-86e8-e55f5ee43670