| Subject | Details |
| :------------- | :---------------------------------------------------------------|
| Rector version | 0.8.56 |
| Installed as | composer dependency |
On PHP 8, I get this deprecation notice:
PHP Deprecated: Required parameter $contentPatcher follows optional parameter $options in /home/benjamin/Projects/ebay-sdk-php/vendor/rector/rector/src/PhpParser/Printer/BetterStandardPrinter.php on line 98
On this line:
public function __construct(CommentRemover $commentRemover, array $options = [], ContentPatcher $contentPatcher)
If I remove the default value however, I get this error:
[ERROR] Cannot autowire service "Rector\Core\PhpParser\Printer\BetterStandardPrinter": argument "$options" of method
"__construct()" is type-hinted "array", you should configure its value explicitly.
Hi,
thanks for reporting!
What about making the non-optional parameters first?
public function __construct(
CommentRemover $commentRemover,
- array $options = [],
+ ContentPatcher $contentPatcher,
- ContentPatcher $contentPatcher
+ array $options = []
)
That should work! If this class is only autowired, changing parameter order should not matter.
We autowire all services by default. Let me know how it works.
If it's good, could you send PR with the fix here?
It does work, and it's actually already been fixed in 2030badc199c918a6baefd7f491585bc71975a57. Waiting for the next release then, thank you! :+1:
Ah, good to know :)
Next release should be ~ week