-
Notifications
You must be signed in to change notification settings - Fork 820
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
NEW: Add phpstan level 1 analysis #9873
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
parameters: | ||
level: 1 | ||
paths: | ||
- src | ||
excludePaths: | ||
# Attempts to link the Parser from php-peg crash phpstan | ||
- src/View/SSTemplateParseException.php | ||
- src/View/SSTemplateParser.php | ||
ignoreErrors: | ||
- | ||
message: '#Class SilverStripe\\Admin\\LeftAndMain not found.#' | ||
path: src/Forms/GridField/GridFieldDetailForm_ItemRequest.php | ||
- | ||
message: '#Class SilverStripe\\CMS\\Model\\SiteTree not found#' | ||
path: src/Core/ClassInfo.php | ||
- | ||
message: '#Class SilverStripe\\CMS\\Model\\SiteTree not found#' | ||
path: src/ORM/Search/FulltextSearchable.php | ||
- | ||
message: '#Class SilverStripe\\CMS\\Model\\SiteTree not found#' | ||
path: src/ORM/Connect/MySQLDatabase.php | ||
- | ||
message: '#Class Page not found#' | ||
path: src/Security/Security.php | ||
- | ||
message: '#Constructor of class .* has an unused parameter \$form#' | ||
path: src/Forms/ConfirmedPasswordField.php | ||
- | ||
message: '#Constructor of class .* has an unused parameter \$extraFields.#' | ||
path: src/ORM/ManyManyThroughList.php | ||
- | ||
message: '#Constructor of class .* has an unused parameter \$database.#' | ||
path: src/ORM/Connect/MySQLQuery.php | ||
- | ||
message: '#Constructor of class .* has an unused parameter \$validator.#' | ||
path: src/Security/LogoutForm.php | ||
- | ||
message: '#Class Parser was not found while trying to analyse it - discovering symbols is probably not configured properly.#' | ||
path: src/View/SSTemplateParser.php | ||
- | ||
message: '#Class Parser was not found while trying to analyse it - discovering symbols is probably not configured properly.#' | ||
path: src/View/SSTemplateParseException.php | ||
|
||
|
||
scanDirectories: | ||
- thirdparty/simpletest | ||
- thirdparty/difflib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,38 +30,7 @@ class DebugView | |
private static $columns = 100; | ||
|
||
protected static $error_types = [ | ||
0 => [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These values aren't being used anywhere, only the errno-mapped ones are. And 2 conflicted with E_USER_WARNING |
||
'title' => 'Emergency', | ||
'class' => 'error' | ||
], | ||
1 => [ | ||
'title' => 'Alert', | ||
'class' => 'error' | ||
], | ||
2 => [ | ||
'title' => 'Critical', | ||
'class' => 'error' | ||
], | ||
3 => [ | ||
'title' => 'Error', | ||
'class' => 'error' | ||
], | ||
4 => [ | ||
'title' => 'Warning', | ||
'class' => 'warning' | ||
], | ||
5 => [ | ||
'title' => 'Notice', | ||
'class' => 'notice' | ||
], | ||
6 => [ | ||
'title' => 'Information', | ||
'class' => 'info' | ||
], | ||
7=> [ | ||
'title' => 'SilverStripe\\Dev\\Debug', | ||
'class' => 'debug' | ||
], | ||
|
||
E_USER_ERROR => [ | ||
'title' => 'User Error', | ||
'class' => 'error' | ||
|
@@ -86,10 +55,6 @@ class DebugView | |
'title' => 'User Deprecated', | ||
'class' => 'notice' | ||
], | ||
E_CORE_ERROR => [ | ||
'title' => 'Core Error', | ||
'class' => 'error' | ||
], | ||
E_WARNING => [ | ||
'title' => 'Warning', | ||
'class' => 'warning' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 variable isn't defined. In theory people could define it in a subclass, but it's far from being a published API. This code goes back to the project's inception and I think it's an oversight.
In Security.php, private static $template is defined, which does not populate this variable - it's used as a config var. Notably, this code on PHP 7.4 failed to print HELLO
In my view, removing this isn't a breaking change, but it's moderately controversial. As an alternative I would add a /** @phpstan-ignore-next-line */ flag; attempting to define template breaks other things.