Skip to content

Code Modernizing / Config, does not behave as expected #8823

Answered by samsonasik
ItsReddi asked this question in Q&A
Discussion options

You must be logged in to vote

For that, it is better to you need to use php 8.4 runtime, otherwise, it may cause unexpected error, eg on required after optional, see https://3v4l.org/5jms6, without nullable, it is working https://3v4l.org/4O5MK, that's why upgrade php step by step is better, to ensure per-feature applied correctly in order.

But if you want it so hard, you can do something like:

<?php

return \Rector\Config\RectorConfig::configure()
    ->withPaths([__DIR__ . '/src'])
    ->withPhpSets(php83: true)
    ->withPhpVersion(\Rector\ValueObject\PhpVersion::PHP_84)
    ->withRules([
         \Rector\Php84\Rector\Param\ExplicitNullableParamTypeRector::class,
    ]);

with the risk is on yours, see answer at issue

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@samsonasik
Comment options

@ItsReddi
Comment options

@samsonasik
Comment options

@ItsReddi
Comment options

@samsonasik
Comment options

Answer selected by samsonasik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants