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

[Rector] Apply Full PHP 7.3 Rector Set List #4600

Closed

Conversation

samsonasik
Copy link
Member

Using :

	$parameters->set(Option::SETS, [
		SetList::PHP_73,
	]);

to apply full php 7.3 rector set list.

Checklist:

  • Securely signed commits

@samsonasik samsonasik force-pushed the apply-rector-php73-feature branch from 2b2182c to dc8f30a Compare April 23, 2021 03:59
Copy link
Member

@paulbalandan paulbalandan left a comment

Choose a reason for hiding this comment

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

I like the JSON_THROW_ON_ERROR flag addition but I'm worrying someone's code will now break and throw the blame on us. I think this should be on the changelog to say that json operations now throw errors to force users to rectify their code.

@@ -45,6 +45,8 @@ parameters:
- '#Return type \(bool\) of method CodeIgniter\\Log\\Logger::(emergency|alert|critical|error|warning|notice|info|debug|log)\(\) should be compatible with return type \(null\) of method Psr\\Log\\LoggerInterface::(emergency|alert|critical|error|warning|notice|info|debug|log)\(\)#'
- '#Return type \(bool\) of method CodeIgniter\\HTTP\\Files\\UploadedFile::move\(\) should be compatible with return type \(CodeIgniter\\Files\\File\) of method CodeIgniter\\Files\\File::move\(\)#'
- '#Return type \(bool\) of method CodeIgniter\\Test\\TestLogger::log\(\) should be compatible with return type \(null\) of method Psr\\Log\\LoggerInterface::log\(\)#'
- '#Parameter \#2 \$assoc of function json_decode expects bool, null given#'
reportUnmatchedIgnoredErrors: false
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be set as true so that we can remove errors no longer applicable.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, it currently shows notice in php < 8

@samsonasik
Copy link
Member Author

I can create another alternative PR for allow JsonThrowOnError, with skip StringifyStrNeedlesRector. Let see if @MGatner have other opinion.

@MGatner
Copy link
Member

MGatner commented Apr 23, 2021

Generally I agree about throwing new errors but looking through these specific instances I think a failed operation will already cause other errors that will just be harder to track down. The exception may be the Toolbar changes but that's only for dev instances anyways when (I believe) we want to be throwing more errors anyway.

@samsonasik
Copy link
Member Author

@MGatner skipping with negation seems not possible as I see right now, eg:

^((?!system\/Debug\/Toolbar\.php).)*$

Manually skip many files seems not the right way.

I think the safest solution is the alternative PR #4601 which skip both JsonThrowOnError and StringifyStrNeedlesRector.

@samsonasik
Copy link
Member Author

Closing in favor of #4601

@samsonasik samsonasik closed this Apr 24, 2021
@samsonasik samsonasik deleted the apply-rector-php73-feature branch April 24, 2021 19:32
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.

3 participants