-
-
Notifications
You must be signed in to change notification settings - Fork 190
TASK: Raise PhpStan to level 8 - Part 1 #3515
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
Conversation
0ab77ed to
4064484
Compare
|
wow thanks a lot! If you need help here let me know;) Also lets ignore the style CI failures as we want to move to php cs either way and they might have different expectations again;) |
eabd7e0 to
0d20ec9
Compare
|
@mhsdesign is suggest to merge this in parts as otherwise the reviews will get really overwhelming. |
0d20ec9 to
5e02f0c
Compare
|
@mhsdesign yes your commits were mostly regarding flow. I cherry pick commits for each section one by one and afterwards remove breakiness and make tests green + verify neos still works. |
|
Okay so this is the final set that should be tested and go into Flow 9.1 then ill review and test that ;) Thanks for splitting this mammoth! |
|
I will try to prepare follow ups that may or may not be ready for 9.1 but imho this is about the maximal size for a pr that is chewable. So imho this can be reviewed and merged |
…ttern in flow if this would be injected flow would not handle this
the change in c6e3247 was half thought and phpstan only complained due to temporary results written.
…s phpstan whats up)
…` is used with `$returnRealPath` but realpaths cannot be calculated This is the case when using a virtual file system for testing in example (`vfs://`) or really any stream wrapper. Silently swallowing all the `realpath` misses disguises bugs and hiders developer experience when using a vfs.
mhsdesign
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviving this change and battling with it to make it run :D
I did a full review locally and pushed some small adjustment changes - just mostly syntactical stuff.
I see we now use a lot of times the pattern ?: '' to convert a false to a string. That is often okay as this the false case should never happen for constant preg expressions but in some cases ignoring this type juggling disguises bugs. So if there is real reason to believe it could happen im definitely for having a sane fallback or telling whats wrong.
Thats exactly why i added a new exception to \Neos\Utility\Files::getRecursiveDirectoryGenerator see 5769192:
BUGFIX: Throw exception when
Files::getRecursiveDirectoryGenerator()is used with$returnRealPathbut realpaths cannot be calculatedThis is the case when using a virtual file system for testing in example (
vfs://) or really any stream wrapper.Silently swallowing all the
realpathmisses disguises bugs and hiders developer experience when using a vfs.
`fopen` is multi thread safe. $lockResource is never `false` unless something is severely wrong with the system like flow has no write access to Data/
> Cannot get realpath for "vfs://fusion/Target.Package/Resources/SomeFile.fusion". $returnRealPath cannot be used with stream wrappers. see neos/flow-development-collection#3515 (review)
> Cannot get realpath for "vfs://fusion/Target.Package/Resources/SomeFile.fusion". $returnRealPath cannot be used with stream wrappers. see neos/flow-development-collection#3515 (review)

Raise PhpStan to level 8 for:
Neos.Flow.LogNeos.FluidAdaptorNeos.Http.FactoriesNeos.KickstarterNeos.Utility.ArraysNeos.Utility.FilesNeos.Utility.MediaTypesNeos.Utility.ObjectHandlingNeos.Utility.OpcodeCacheNeos.Utility.PdoNeos.Utility.SchemaNeos.Utility.UnicodeUpgrade instructions
No changes needed.
Review instructions
This the first of multiple PRs to cherry pick the changes from #3474 from @nezaniel and @mhsdesign step by step and fix issues and breakiness.
This is intended to be unbreaky but be the foundation for future refactorings that can at least partly be automated once we have really solid type informations.
Checklist
FEATURE|TASK|BUGFIX!!!and have upgrade-instructions