|
| 1 | +<?xml version="1.0"?> |
| 2 | +<ruleset name="ProjektMOTOR"> |
| 3 | + <description>The ProjektMOTOR coding standard.</description> |
| 4 | + |
| 5 | + <rule ref="PSR1.Methods.CamelCapsMethodName"> |
| 6 | + <exclude-pattern>tests/*</exclude-pattern> |
| 7 | + </rule> |
| 8 | + |
| 9 | + <!-- Include the whole Symfony standard --> |
| 10 | + <rule ref="vendor/escapestudios/symfony2-coding-standard/Symfony/ruleset.xml"><!-- relative path to your ruleset.xml --> |
| 11 | + <!-- sniffs to exclude --> |
| 12 | + <exclude name="Symfony.Commenting.ClassComment.Missing" /> |
| 13 | + <exclude name="Symfony.Commenting.FunctionComment.Missing" /> |
| 14 | + <exclude name="Symfony.Commenting.License.Warning" /> |
| 15 | + <exclude name="Symfony.Functions.Arguments.Invalid" /> |
| 16 | + <exclude name="Symfony.NamingConventions.ValidClassName.InvalidInterfaceName" /> |
| 17 | + <exclude name="Symfony.NamingConventions.ValidClassName.InvalidTraitName" /> |
| 18 | + <exclude name="Squiz.Strings.ConcatenationSpacing.PaddingFound" /> |
| 19 | + </rule> |
| 20 | + |
| 21 | + |
| 22 | + <rule ref="vendor/slevomat/coding-standard/SlevomatCodingStandard/ruleset.xml"><!-- relative path to your ruleset.xml --> |
| 23 | + <!-- keep it for debugging reasons to be able to list all rules vendor/bin/phpcs -e | grep SlevomatCodingStandard --> |
| 24 | + <!--<exclude name="*" />--> |
| 25 | + <exclude name="SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants.DisallowedLateStaticBindingForConstant" /> |
| 26 | + <exclude name="SlevomatCodingStandard.Classes.TraitUseSpacing.IncorrectLinesCountAfterLastUse" /> |
| 27 | + <exclude name="SlevomatCodingStandard.Classes.TraitUseSpacing.IncorrectLinesCountBeforeFirstUse" /> |
| 28 | + <exclude name="SlevomatCodingStandard.Commenting.DisallowOneLinePropertyDocComment.OneLinePropertyComment" /> |
| 29 | + <exclude name="SlevomatCodingStandard.Commenting.DocCommentSpacing.IncorrectLinesCountBetweenDifferentAnnotationsTypes" /> |
| 30 | + <exclude name="SlevomatCodingStandard.ControlStructures.ControlStructureSpacing.IncorrectLinesCountBeforeControlStructure" /> |
| 31 | + <exclude name="SlevomatCodingStandard.ControlStructures.ControlStructureSpacing.IncorrectLinesCountAfterControlStructure" /> |
| 32 | + <exclude name="SlevomatCodingStandard.ControlStructures.DisallowEmpty.DisallowedEmpty" /> |
| 33 | + <!-- cause they are allowed and wanted in symfony --> |
| 34 | + <exclude name="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison.DisallowedYodaComparison" /> |
| 35 | + <!-- threw a false positive in ArticleImportCommand of HSM --> |
| 36 | + <exclude name="SlevomatCodingStandard.ControlStructures.EarlyExit.EarlyExitNotUsed" /> |
| 37 | + <exclude name="SlevomatCodingStandard.ControlStructures.NewWithoutParentheses.UselessParentheses" /> |
| 38 | + <exclude name="SlevomatCodingStandard.ControlStructures.RequireMultiLineTernaryOperator.MultiLineTernaryOperatorNotUsed" /> |
| 39 | + <exclude name="SlevomatCodingStandard.ControlStructures.RequireShortTernaryOperator.RequiredShortTernaryOperator" /> |
| 40 | + <exclude name="SlevomatCodingStandard.ControlStructures.RequireYodaComparison.RequiredYodaComparison" /> |
| 41 | + <exclude name="SlevomatCodingStandard.Functions.TrailingCommaInCall.MissingTrailingComma" /> |
| 42 | + <!-- didn't work with symfony form types cause of unused param options --> |
| 43 | + <exclude name="SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter" /> |
| 44 | + <exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation.NonFullyQualifiedClassName"/> |
| 45 | + <exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedExceptions.NonFullyQualifiedException"/> |
| 46 | + <exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName"/> |
| 47 | + <exclude name="SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces"/> |
| 48 | + <!-- $count++ is not allowed wtf --> |
| 49 | + <exclude name="SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators.DisallowedPostIncrementOperator"/> |
| 50 | + <exclude name="SlevomatCodingStandard.TypeHints.DisallowArrayTypeHintSyntax.DisallowedArrayTypeHintSyntax"/> |
| 51 | + <exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableParameterTypeHintSpecification"/> |
| 52 | + <exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableReturnTypeHintSpecification"/> |
| 53 | + <exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.UselessDocComment"/> |
| 54 | + <exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.UselessParameterAnnotation"/> |
| 55 | + <exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.UselessReturnAnnotation"/> |
| 56 | + </rule> |
| 57 | + |
| 58 | + <rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"> |
| 59 | + <properties> |
| 60 | + <property name="searchAnnotations" value="true"/> |
| 61 | + </properties> |
| 62 | + </rule> |
| 63 | + |
| 64 | + <rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"> |
| 65 | + <properties> |
| 66 | + <property name="newlinesCountBetweenOpenTagAndDeclare" value="1"/> |
| 67 | + <property name="spacesCountAroundEqualsSign" value="0"/> |
| 68 | + </properties> |
| 69 | + </rule> |
| 70 | + |
| 71 | + <rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName"> |
| 72 | + <properties> |
| 73 | + <property |
| 74 | + name="rootNamespaces" |
| 75 | + type="array" |
| 76 | + value=" |
| 77 | + tests=>App\Tests, |
| 78 | + src=>App, |
| 79 | + " |
| 80 | + /> |
| 81 | + <property name="ignoredNamespaces" type="array" value="DoctrineMigrations"/> |
| 82 | + </properties> |
| 83 | + </rule> |
| 84 | + |
| 85 | + <rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName"> |
| 86 | + <exclude-pattern>config/bundles.php</exclude-pattern> |
| 87 | + <exclude-pattern>src/Kernel.php</exclude-pattern> |
| 88 | + </rule> |
| 89 | + |
| 90 | + <rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration"> |
| 91 | + <properties> |
| 92 | + <property |
| 93 | + name="usefulAnnotations" |
| 94 | + type="array" |
| 95 | + value=" |
| 96 | + @after, |
| 97 | + @before, |
| 98 | + @dataProvider, |
| 99 | + @deprecated, |
| 100 | + @required, |
| 101 | + @see, |
| 102 | + @ApiDoc, |
| 103 | + @Assert\, |
| 104 | + @QueryParam, |
| 105 | + @ORM\, |
| 106 | + @ParamConverter, |
| 107 | + @Route, |
| 108 | + @Template, |
| 109 | + @Security, |
| 110 | + @Method, |
| 111 | + @IsGranted, |
| 112 | + @Operation |
| 113 | + " |
| 114 | + /> |
| 115 | + <property name="enableEachParameterAndReturnInspection" value="true"/> |
| 116 | + </properties> |
| 117 | + </rule> |
| 118 | + |
| 119 | + <rule ref="SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces"> |
| 120 | + <properties> |
| 121 | + <property name="linesCountAfterOpeningBrace" value="0"/> |
| 122 | + <property name="linesCountBeforeClosingBrace" value="0"/> |
| 123 | + </properties> |
| 124 | + </rule> |
| 125 | + |
| 126 | + <rule ref="Generic.Files.LineLength"> |
| 127 | + <properties> |
| 128 | + <property name="lineLimit" value="150" /> |
| 129 | + <property name="absoluteLineLimit" value="150" /> |
| 130 | + </properties> |
| 131 | + </rule> |
| 132 | + |
| 133 | + <exclude-pattern>./src/Migrations/*</exclude-pattern> |
| 134 | + <exclude-pattern>./public/index.php</exclude-pattern> |
| 135 | + <exclude-pattern>./config/bundles.php</exclude-pattern> |
| 136 | + <exclude-pattern>./config/bootstrap.php</exclude-pattern> |
| 137 | + |
| 138 | + <file>bin/</file> |
| 139 | + <file>config/</file> |
| 140 | + <file>public/</file> |
| 141 | + <file>src/</file> |
| 142 | + <file>tests/</file> |
| 143 | + |
| 144 | +</ruleset> |
0 commit comments