-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f161d45
commit 0ce4639
Showing
12 changed files
with
62 additions
and
54 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ jobs: | |
with: | ||
args: --ignore-platform-reqs | ||
- run: composer cs:check | ||
- run: composer md |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="Parcel Pro PHPMD Ruleset" | ||
xmlns="http://pmd.sf.net/ruleset/1.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" | ||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> | ||
<description>The Parcel Pro mess detection ruleset.</description> | ||
|
||
<!-- See: https://phpmd.org/rules/index.html --> | ||
|
||
<rule ref="rulesets/cleancode.xml"> | ||
<exclude name="StaticAccess"/> | ||
<exclude name="ElseExpression"/> | ||
<exclude name="BooleanArgumentFlag"/> | ||
</rule> | ||
|
||
<rule ref="rulesets/design.xml"/> | ||
|
||
<rule ref="rulesets/unusedcode.xml"> | ||
<exclude name="UnusedLocalVariable"/> | ||
</rule> | ||
<!-- | ||
We don't want to use the standard "UnusedLocalVariable" rule, since it gives a false-positive in this scenario: | ||
`foreach ($arr as $key => $value) {` | ||
where only `$key` is used. | ||
Instead, we want to be able to use `$_` instead of `$value` to indicate an unused variable. | ||
The above example would then become: | ||
`foreach ($arr as $key => $_) {` | ||
--> | ||
<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"> | ||
<properties> | ||
<property name="exceptions" value="_"/> | ||
</properties> | ||
</rule> | ||
</ruleset> |