-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
TASK: PhpStan level 1 for Neos 8.3 #4842
Conversation
2b82a2c
to
1ef2c6d
Compare
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.
Fyi
@@ -597,7 +597,7 @@ public function getGroupedOpcodes($context = 3) | |||
]; | |||
} | |||
|
|||
if (!empty($group) && !(count($group) == 1 && $group[0][0] == 'equal')) { | |||
if (!(count($group) == 1 && $group[0][0] == 'equal')) { |
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.
this is a bit tricky but phpstan was really stubborn that this check is obsolete and it 100% is.
$group is never empty because it is filled in the foreach above where the variable $opCodes always have at least one entry.
@@ -922,6 +922,7 @@ public function getProperty($propertyName, bool $returnNodesAsIdentifiers = fals | |||
} | |||
|
|||
if ( | |||
/** @phpstan-ignore-next-line i will not touch this code */ |
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.
The old Node::getProperty does uuuuuglly things :D And i dont want to appear in its git blame :D
@@ -168,6 +168,7 @@ public function setOptions($options) | |||
*/ | |||
public static function createByConfiguration($modeName, array $configuration) | |||
{ | |||
/** @phpstan-ignore-next-line */ |
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.
the user interface mode will be refactored either way with neos 9 ^^
@@ -110,6 +110,7 @@ public function processRequest(ActionRequest $request, ActionResponse $response) | |||
*/ | |||
protected function convertException(\Exception $exception) | |||
{ | |||
$exceptionData = []; |
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.
line 146 could in a very unlikely case throw an Error because the variable is not initialised.
Also line 116 makes use of phps implicit variable array initialisation which is unexpected ^^
89bd03f
to
ee2ab6e
Compare
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.
Some nitpicks! Thank you for taking care of code quality!
Neos.Media/Classes/Domain/Model/AssetSource/Neos/NeosAssetProxyQueryResult.php
Outdated
Show resolved
Hide resolved
ee2ab6e
to
5651c01
Compare
5651c01
to
6b338b4
Compare
Adds phpstan to the Neos 8.3 branch to all packages with a minimal level 1:
Errors caused by the back-port of the ESCR TraversableNodeInterface, have been directly ignored via
ignoreErrors
.Other actually fixable errors have been fixed in a non breaking way. (Adjusting the doc types e.g.)
This should provide a little starting base for extending php stan level across all packages to higher levels in the upcoming 9.0 branch, where we actually use phpstan at level 8 for the following packages:
As
Neos.Fusion
didnt need to be adjusted for neos 9 i started to migrate this package to level 8 for neos 8.3 already to avoid too many upmerge conflicts:#4844
More packages, if applicable, will follow.
Upgrade instructions
Review instructions
Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions