Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.4 Implicitly marking parameter as nullable is deprecated, the explicit nullable type must be used instead #352

Closed
PhilETaylor opened this issue Nov 22, 2024 · 6 comments · Fixed by rectorphp/rector-downgrade-php#243 or rectorphp/rector-downgrade-php#245

Comments

@PhilETaylor
Copy link
Contributor

PhilETaylor commented Nov 22, 2024

PHP Deprecated: Rector\Doctrine\NodeManipulator\ColumnPropertyTypeResolver::__construct(): Implicitly marking parameter $doctrineTypeToScalarType as nullable is deprecated, the explicit nullable type must be used instead in /Users/phil/Sites/example.com/vendor/rector/rector/vendor/rector/rector-doctrine/src/NodeManipulator/ColumnPropertyTypeResolver.php on line 51

Deprecated: Rector\Doctrine\NodeManipulator\ColumnPropertyTypeResolver::__construct(): Implicitly marking parameter $doctrineTypeToScalarType as nullable is deprecated, the explicit nullable type must be used instead in /Users/phil/Sites/example.com/vendor/rector/rector/vendor/rector/rector-doctrine/src/NodeManipulator/ColumnPropertyTypeResolver.php on line 51

@PhilETaylor
Copy link
Contributor Author

PhilETaylor commented Nov 22, 2024

Hmm I think this has already been addressed as the current line 51 in the main branch, is not the same as the line 51 that I have on my mac :)

@samsonasik
Copy link
Member

That seems after downgrade, nullable should be added when add null default value. This should be covered on downgrade process to support php 8.4 syntax while downgrade to php 7.4

@samsonasik samsonasik reopened this Nov 22, 2024
@samsonasik
Copy link
Member

samsonasik commented Nov 22, 2024

Reproduced at https://getrector.com/demo/876d65e2-7925-4f73-bf92-a208de6dc5ff

on apply rules:

-   DowngradePropertyPromotionRector
-  DowngradeNewInInitializerRector

@samsonasik
Copy link
Member

@samsonasik
Copy link
Member

Re-open, needs to relook more :)

@samsonasik
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment