Use "Respect" coding standard

There are too many PHP_CodeSniffer configurations in this repository.

I have created "respect/coding-standard" to deal with all the
configuration so in this repository we only need to add "Respect" as our
PHP_CodeSniffer rule.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
This commit is contained in:
Henrique Moody 2019-05-11 20:51:39 +02:00
parent 272f18dcf5
commit 16376306f8
No known key found for this signature in database
GPG Key ID: 221E9281655813A6
2 changed files with 2 additions and 149 deletions

View File

@ -22,14 +22,13 @@
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
"egulias/email-validator": "^2.0",
"escapestudios/symfony2-coding-standard": "^3.8",
"malukenho/docheader": "^0.1.4",
"mikey179/vfsstream": "^1.6",
"phpstan/phpstan": "^0.11",
"phpstan/phpstan-deprecation-rules": "^0.11.0",
"phpstan/phpstan-phpunit": "^0.11.0",
"phpunit/phpunit": "^7.3",
"slevomat/coding-standard": "^5.0",
"respect/coding-standard": "^1.0",
"squizlabs/php_codesniffer": "^3.4",
"symfony/validator": "^3.0||^4.0",
"zendframework/zend-validator": "^2.1"

View File

@ -14,151 +14,5 @@
<file>library/</file>
<file>tests/</file>
<rule ref="PSR1" />
<rule ref="PSR2" />
<rule ref="Generic.Arrays.ArrayIndent" />
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
<rule ref="Generic.Formatting.SpaceAfterNot">
<properties>
<property name="spacing" value="0" />
</properties>
</rule>
<rule ref="Generic.NamingConventions.CamelCapsFunctionName" />
<rule ref="Generic.PHP.NoSilencedErrors" />
<rule ref="Generic.Strings.UnnecessaryStringConcat">
<properties>
<property name="allowMultiline" value="true" />
</properties>
</rule>
<rule ref="Generic.WhiteSpace.ArbitraryParenthesesSpacing" />
<rule ref="Generic.WhiteSpace.IncrementDecrementSpacing" />
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent" />
<rule ref="SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation" />
<rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma" />
<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility" />
<rule ref="SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants" />
<rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference" />
<rule ref="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming" />
<rule ref="SlevomatCodingStandard.Classes.SuperfluousTraitNaming" />
<rule ref="SlevomatCodingStandard.Classes.TraitUseDeclaration" />
<rule ref="SlevomatCodingStandard.Classes.TraitUseSpacing">
<properties>
<property name="linesCountBeforeFirstUse" value="0" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.AssignmentInCondition" />
<rule ref="SlevomatCodingStandard.ControlStructures.ControlStructureSpacing">
<properties>
<property name="tokensToCheck" type="array">
<element value="T_RETURN" />
</property>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowContinueWithoutIntegerOperandInSwitch" />
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison" />
<rule ref="SlevomatCodingStandard.ControlStructures.EarlyExit" />
<rule ref="SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses" />
<rule ref="SlevomatCodingStandard.ControlStructures.NewWithParentheses" />
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator" />
<rule ref="SlevomatCodingStandard.ControlStructures.RequireShortTernaryOperator" />
<rule ref="SlevomatCodingStandard.ControlStructures.RequireTernaryOperator" />
<rule ref="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn" />
<rule ref="SlevomatCodingStandard.ControlStructures.UselessTernaryOperator" />
<rule ref="SlevomatCodingStandard.Exceptions.DeadCatch" />
<rule ref="SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly" />
<rule ref="SlevomatCodingStandard.Functions.StaticClosure" />
<rule ref="SlevomatCodingStandard.Functions.UselessParameterDefaultValue" />
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses" />
<rule ref="SlevomatCodingStandard.Namespaces.DisallowGroupUse" />
<rule ref="SlevomatCodingStandard.Namespaces.NamespaceDeclaration" />
<rule ref="SlevomatCodingStandard.Namespaces.NamespaceSpacing" />
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
<properties>
<property name="allowFallbackGlobalConstants" value="false"/>
<property name="allowFallbackGlobalFunctions" value="false"/>
<property name="allowFullyQualifiedGlobalClasses" value="false"/>
<property name="allowFullyQualifiedGlobalConstants" value="false"/>
<property name="allowFullyQualifiedGlobalFunctions" value="false"/>
<property name="allowFullyQualifiedNameForCollidingClasses" value="true"/>
<property name="allowFullyQualifiedNameForCollidingConstants" value="true"/>
<property name="allowFullyQualifiedNameForCollidingFunctions" value="true"/>
<property name="searchAnnotations" value="true"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.RequireOneNamespaceInFile" />
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" value="true" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash" />
<rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace" />
<rule ref="SlevomatCodingStandard.Namespaces.UselessAlias" />
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing" />
<rule ref="SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking" />
<rule ref="SlevomatCodingStandard.PHP.ShortList" />
<rule ref="SlevomatCodingStandard.PHP.TypeCast" />
<rule ref="SlevomatCodingStandard.PHP.UselessParentheses" />
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon" />
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing" />
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing" />
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="newlinesCountBetweenOpenTagAndDeclare" value="2" />
<property name="spacesCountAroundEqualsSign" value="0" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue" />
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration">
<properties>
<property name="allAnnotationsAreUseful" value="true" />
<property name="enableEachParameterAndReturnInspection" value="true" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.UselessConstantTypeHint" />
<rule ref="SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable" />
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable" />
<rule ref="SlevomatCodingStandard.Variables.UselessVariable" />
<rule ref="Squiz.PHP.CommentedOutCode" />
<rule ref="Squiz.WhiteSpace.FunctionSpacing">
<properties>
<property name="spacing" value="1" />
<property name="spacingBeforeFirst" value="0" />
<property name="spacingAfterLast" value="0" />
</properties>
</rule>
<rule ref="Squiz.Strings.ConcatenationSpacing">
<properties>
<property name="spacing" value="0" />
<property name="ignoreNewlines" value="true" />
</properties>
</rule>
<rule ref="Squiz.Strings.DoubleQuoteUsage"/>
<rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar">
<message>Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead</message>
</rule>
<rule ref="Squiz.WhiteSpace.MemberVarSpacing">
<properties>
<property name="spacing" value="1" />
<property name="spacingBeforeFirst" value="0" />
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.LanguageConstructSpacing" />
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing" />
<rule ref="Squiz.WhiteSpace.ObjectOperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true" />
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.OperatorSpacing" />
<rule ref="Squiz.WhiteSpace.SemicolonSpacing" />
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>
<property name="ignoreBlankLines" value="false" />
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
<severity>5</severity>
</rule>
<rule ref="Symfony.Functions.ScopeOrder" />
<rule ref="Respect" />
</ruleset>