Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Dec 12, 2024

eases migration to PHPStan 2.x while staying compatible with PHPStan 1.x for now

@staabm staabm marked this pull request as ready for review December 12, 2024 20:34
@staabm
Copy link
Contributor Author

staabm commented Dec 12, 2024

the rector GH action fail looks unrelated

…precated.

Use Type::getObjectClassNames() or Type::getObjectClassReflections() instead.
"php": "^8.2",
"phpstan/phpstan": "^1.10.50"
"phpstan/phpstan": "^1.10.50",
"nikic/php-parser": "^4"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stick to php-parser v4 as otherwise v5 would be installed automatically and be in conflict with rector v1 and phpstan v1

$parameterClassReflection = $parameterType->getClassReflection();
if (! $parameterClassReflection instanceof ClassReflection) {
$classReflections = $parameterType->getObjectClassReflections();
// XXX add support for union types
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unions were not supported before this PR either. just making the TODO explicit for now

@TomasVotruba
Copy link
Owner

Looks good to me, thank you 👍

@TomasVotruba TomasVotruba merged commit 1c9472c into TomasVotruba:main Dec 12, 2024
5 of 6 checks passed
@staabm staabm deleted the stan1 branch December 13, 2024 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants