|
| 1 | +<?xml version="1.0"?> |
| 2 | +<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHPParallelLint" xsi:noNamespaceSchemaLocation="../vendor/squizlabs/php_codesniffer/phpcs.xsd"> |
| 3 | + |
| 4 | + <description>A coding standard for projects in the PHP Parallel Lint organisation.</description> |
| 5 | + |
| 6 | + <!-- |
| 7 | + ############################################################################# |
| 8 | + CHECK CODE STYLE AGAINST PSR12 |
| 9 | + https://www.php-fig.org/psr/psr-12/ |
| 10 | + ############################################################################# |
| 11 | + --> |
| 12 | + <rule ref="PSR12"> |
| 13 | + <!-- Constant visibility is a PHP 7.1 feature and cannot (yet) be used. --> |
| 14 | + <exclude name="PSR12.Properties.ConstantVisibility"/> |
| 15 | + </rule> |
| 16 | + |
| 17 | + <!-- ## Sniff specific configuration for sniffs included in PSR12 ## --> |
| 18 | + |
| 19 | + <rule ref="Generic.Files.LineLength"> |
| 20 | + <properties> |
| 21 | + <property name="lineLimit" value="125"/> |
| 22 | + <property name="absoluteLineLimit" value="200"/> |
| 23 | + </properties> |
| 24 | + </rule> |
| 25 | + |
| 26 | + <rule ref="PSR12.ControlStructures.BooleanOperatorPlacement"> |
| 27 | + <properties> |
| 28 | + <!-- Only allow them at the start of the line. --> |
| 29 | + <property name="allowOnly" value="first"/> |
| 30 | + </properties> |
| 31 | + </rule> |
| 32 | + |
| 33 | + |
| 34 | + <!-- |
| 35 | + ############################################################################# |
| 36 | + SNIFF FOR PHP CROSS-VERSION COMPATIBILITY |
| 37 | + https://github.com/PHPCompatibility/PHPCompatibility/ |
| 38 | +
|
| 39 | + It is STRONGLY recommended for individual projects to set a `testVersion` |
| 40 | + config indicating which PHP versions should be supported. |
| 41 | + https://github.com/PHPCompatibility/PHPCompatibility/#using-a-custom-ruleset |
| 42 | + ############################################################################# |
| 43 | + --> |
| 44 | + |
| 45 | + <rule ref="PHPCompatibility"/> |
| 46 | + |
| 47 | + |
| 48 | + <!-- |
| 49 | + ############################################################################# |
| 50 | + MISCELLANEOUS ADDITIONAL RULES |
| 51 | + ############################################################################# |
| 52 | + --> |
| 53 | + |
| 54 | + <rule ref="Generic.Arrays.ArrayIndent"/> |
| 55 | + |
| 56 | + <rule ref="Generic.CodeAnalysis.EmptyStatement"/> |
| 57 | + <rule ref="Generic.CodeAnalysis.EmptyPHPStatement"/> |
| 58 | + <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/> |
| 59 | + <rule ref="Generic.CodeAnalysis.JumbledIncrementer"/> |
| 60 | + <rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/> |
| 61 | + <rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/> |
| 62 | + <rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/> |
| 63 | + |
| 64 | + <rule ref="Generic.ControlStructures.DisallowYodaConditions"/> |
| 65 | + |
| 66 | + <rule ref="Generic.Formatting.SpaceAfterCast"/> |
| 67 | + |
| 68 | + <rule ref="Generic.Metrics.CyclomaticComplexity"/> |
| 69 | + <rule ref="Generic.Metrics.NestingLevel"/> |
| 70 | + |
| 71 | + <rule ref="Generic.NamingConventions.ConstructorName"/> |
| 72 | + |
| 73 | + <rule ref="Generic.PHP.ForbiddenFunctions"/> |
| 74 | + <rule ref="Generic.PHP.NoSilencedErrors"/> |
| 75 | + |
| 76 | + <rule ref="Generic.Strings.UnnecessaryStringConcat"/> |
| 77 | + |
| 78 | + <rule ref="PEAR.Commenting.InlineComment"/> |
| 79 | + |
| 80 | + <rule ref="Squiz.Arrays.ArrayBracketSpacing"/> |
| 81 | + |
| 82 | + <rule ref="Squiz.PHP.GlobalKeyword"/> |
| 83 | + <rule ref="Squiz.PHP.LowercasePHPFunctions"/> |
| 84 | + <rule ref="Squiz.PHP.NonExecutableCode"/> |
| 85 | + |
| 86 | + <rule ref="Squiz.WhiteSpace.SemicolonSpacing"/> |
| 87 | + |
| 88 | +</ruleset> |
0 commit comments