phpcs.xml
Rama master · réplica de lectura del repositorio original.
<?xml version="1.0"?>
<ruleset name="StrictPSR12" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<description>Strict PSR12 code style standard</description>
<arg name="basepath" value="."/>
<arg name="cache" value=".phpcs-cache"/>
<arg name="colors"/>
<arg name="extensions" value="php"/>
<file>src</file>
<rule ref="PSR12">
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen"/>
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose"/>
<exclude name="PSR12.Functions.ReturnTypeDeclaration"/>
</rule>
<rule ref="Generic.Files.LineLength">
<exclude name="Generic.Files.LineLength.TooLong"/>
</rule>
<rule ref="Generic.PHP.CharacterBeforePHPOpeningTag"/>
<rule ref="Generic.PHP.DisallowShortOpenTag">
<exclude name="Generic.PHP.DisallowShortOpenTag.EchoFound"/>
</rule>
<!-- <rule ref="Generic.Files.InlineHTML"/>-->
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<!-- <rule ref="Generic.PHP.BacktickOperator"/>-->
<!-- <rule ref="Generic.PHP.DiscourageGoto"/>-->
<!-- <rule ref="Squiz.PHP.GlobalKeyword"/>-->
<!-- <rule ref="Generic.PHP.SAPIUsage"/>-->
<!-- <rule ref="Generic.PHP.ForbiddenFunctions">-->
<!-- <properties>-->
<!-- <property name="forbiddenFunctions" type="array">-->
<!-- <element key="chop" value="rtrim"/>-->
<!-- <element key="close" value="closedir"/>-->
<!-- <element key="compact" value="null"/>-->
<!-- <element key="delete" value="unset"/>-->
<!-- <element key="doubleval" value="floatval"/>-->
<!-- <element key="extract" value="null"/>-->
<!-- <element key="fputs" value="fwrite"/>-->
<!-- <element key="ini_alter" value="ini_set"/>-->
<!-- <element key="is_double" value="is_float"/>-->
<!-- <element key="is_integer" value="is_int"/>-->
<!-- <element key="is_long" value="is_int"/>-->
<!-- <element key="is_null" value="null"/>-->
<!-- <element key="is_real" value="is_float"/>-->
<!-- <element key="is_writeable" value="is_writable"/>-->
<!-- <element key="join" value="implode"/>-->
<!-- <element key="key_exists" value="array_key_exists"/>-->
<!-- <element key="pos" value="current"/>-->
<!-- <element key="settype" value="null"/>-->
<!-- <element key="show_source" value="highlight_file"/>-->
<!-- <element key="sizeof" value="count"/>-->
<!-- <element key="strchr" value="strstr"/>-->
<!-- </property>-->
<!-- </properties>-->
<!-- </rule>-->
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
<!-- <rule ref="WebimpressCodingStandard.PHP.RedundantSemicolon"/>-->
<!-- <rule ref="Squiz.PHP.NonExecutableCode"/>-->
<!-- <rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/>-->
<!-- <rule ref="WebimpressCodingStandard.Formatting.RedundantParentheses"/>-->
<rule ref="Squiz.PHP.LowercasePHPFunctions"/>
<rule ref="WebimpressCodingStandard.WhiteSpace.BlankLine"/>
<rule ref="WebimpressCodingStandard.WhiteSpace.BraceBlankLine"/>
<rule ref="Squiz.Strings.ConcatenationSpacing">
<properties>
<property name="spacing" value="1"/>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<rule ref="WebimpressCodingStandard.Strings.NoConcatenationAtTheEnd"/>
<rule ref="Generic.Strings.UnnecessaryStringConcat">
<!-- But multiline is useful for readability -->
<properties>
<property name="allowMultiline" value="true"/>
</properties>
</rule>
<!-- The short array syntax MUST be used to define arrays. -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<!-- All values in multiline arrays must be indented with 4 spaces. -->
<rule ref="Generic.Arrays.ArrayIndent"/>
<rule ref="WebimpressCodingStandard.Arrays.TrailingArrayComma"/>
<rule ref="WebimpressCodingStandard.Arrays.Format"/>
<!-- <rule ref="SlevomatCodingStandard.PHP.ShortList"/>-->
<rule ref="WebimpressCodingStandard.WhiteSpace.Namespace"/>
<!-- <!– There MAY NOT be a space around a namespace separator. –>-->
<rule ref="WebimpressCodingStandard.WhiteSpace.NamespaceSeparator"/>
<!-- <!– Import statements MUST be alphabetically sorted. –>-->
<rule ref="WebimpressCodingStandard.Namespaces.AlphabeticallySortedUses"/>
<!-- Functions and const keywords MUST be lowercase in import statements. -->
<rule ref="WebimpressCodingStandard.Namespaces.ConstAndFunctionKeywords"/>
<!-- <!– Unused import statements MUST be removed.–>-->
<rule ref="WebimpressCodingStandard.Namespaces.UnusedUseStatement"/>
<!-- <!– Superfluous leading backslash in import statements MUST be removed. –>-->
<rule ref="WebimpressCodingStandard.Namespaces.UseDoesNotStartWithBackslash"/>
<!-- <!– Fancy group import statements MUST NOT be used. –>-->
<rule ref="SlevomatCodingStandard.Namespaces.DisallowGroupUse"/>
<!-- <!– Each import statement MUST be on its own line. –>-->
<rule ref="SlevomatCodingStandard.Namespaces.MultipleUsesPerLine"/>
<!-- <!– Import statements must be grouped (classes, functions, constants) and-->
<!-- MUST be separated by empty lines. –>-->
<rule ref="SlevomatCodingStandard.Namespaces.NamespaceSpacing"/>
<!-- <!– Import statements aliases for classes, traits, functions and constants-->
<!-- MUST be useful. –>-->
<rule ref="WebimpressCodingStandard.Namespaces.RedundantAlias"/>
<!-- <!– Classes, traits, interfaces, constants and functions MUST be imported. –>-->
<!-- <rule ref="WebimpressCodingStandard.PHP.DisallowFqn"/>-->
<!-- <rule ref="Generic.Classes.DuplicateClassName"/>-->
<!-- <!– The file name MUST match the case of the terminating class name. –>-->
<!-- <rule ref="Squiz.Classes.ClassFileName"/>-->
<!-- <!– PHP 4 style constructors MUST NOT be used. –>-->
<rule ref="Generic.NamingConventions.ConstructorName"/>
<!-- <!– Abstract classes MUST have a `Abstract` prefix. –>-->
<rule ref="WebimpressCodingStandard.NamingConventions.AbstractClass"/>
<!-- <!– Exception classes MUST have a `Exception` suffix. –>-->
<!-- <rule ref="WebimpressCodingStandard.NamingConventions.Exception"/>-->
<!-- <!– Interface classes MUST have a `Interface` suffix. –>-->
<rule ref="WebimpressCodingStandard.NamingConventions.Interface"/>
<!-- <!– Trait classes MUST have a `Trait` suffix. –>-->
<!-- <rule ref="WebimpressCodingStandard.NamingConventions.Trait"/>-->
<!-- <!– Correct class name casing MUST be used. –>-->
<!-- <rule ref="WebimpressCodingStandard.PHP.CorrectClassNameCase"/>-->
<!-- <!– For self-reference a class lower-case `self::` MUST be used without-->
<!-- spaces around the scope resolution operator. –>-->
<!-- <rule ref="Squiz.Classes.SelfMemberReference"/>-->
<!-- <!– Class name resolution via `::class` MUST be used instead of-->
<!-- `__CLASS__`, `get_class()`, `get_class($this)`,-->
<!-- `get_called_class()`, `get_parent_class()` and string reference. –>-->
<!-- <rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference"/>-->
<!-- <rule ref="WebimpressCodingStandard.Formatting.StringClassReference"/>-->
<!-- <!– There MAY NOT be any whitespace around the double colon operator. –>-->
<!-- <rule ref="WebimpressCodingStandard.Formatting.DoubleColon"/>-->
<!-- <!– Traits MUST be sorted alphabetically. –>-->
<rule ref="WebimpressCodingStandard.Classes.AlphabeticallySortedTraits"/>
<!-- <!– There MUST be a single empty line between methods in a class. –>-->
<rule ref="WebimpressCodingStandard.Methods.LineAfter"/>
<!-- The pseudo-variable `$this` MUST NOT be called inside a static method
or function. -->
<rule ref="Squiz.Scope.StaticThisUsage"/>
<!-- Returned variables SHOULD be useful and SHOULD NOT be assigned to a value
and returned on the next line. -->
<rule ref="SlevomatCodingStandard.Variables.UselessVariable"/>
<rule ref="WebimpressCodingStandard.WhiteSpace.CommaSpacing"/>
<rule ref="WebimpressCodingStandard.Formatting.NoSpaceAfterSplat"/>
<rule ref="WebimpressCodingStandard.Formatting.Reference"/>
<!-- The question mark MUST be used when the default argument value is null. -->
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/>
<!-- The final keyword on methods MUST be omitted in final classes. -->
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
<!-- There SHOULD be one single space after `break` and `continue` structures with
a numeric argument argument. -->
<rule ref="WebimpressCodingStandard.ControlStructures.BreakAndContinue"/>
<!-- Statements MUST NOT be empty, except for catch statements. -->
<rule ref="Generic.CodeAnalysis.EmptyStatement">
<!-- But allow empty catch -->
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/>
</rule>
<!-- The `continue` control structure MUST NOT be used in switch statements,
`break` SHOULD be used instead. -->
<rule ref="WebimpressCodingStandard.ControlStructures.ContinueInSwitch"/>
<!-- All catch blocks MUST be reachable. -->
<rule ref="SlevomatCodingStandard.Exceptions.DeadCatch"/>
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<!-- <!– There MUST NOT be any white space around the object operator UNLESS-->
<!-- multilines are used. –>-->
<!-- <rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>-->
<!-- <rule ref="Squiz.WhiteSpace.ObjectOperatorSpacing">-->
<!-- <properties>-->
<!-- <property name="ignoreNewlines" value="true"/>-->
<!-- </properties>-->
<!-- </rule>-->
<!-- <!– Loose comparison operators SHOULD NOT be used, use strict comparison-->
<!-- operators instead. –>-->
<!-- <rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators"/>-->
<!-- <!– The null coalesce operator MUST be used when possible. –>-->
<!-- <rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator"/>-->
<!-- <!– Assignment operators SHOULD be used when possible. –>-->
<!-- <rule ref="SlevomatCodingStandard.Operators.RequireCombinedAssignmentOperator"/>-->
<!-- The `&&` and `||` operators SHOULD be used instead of `and` and `or`. -->
<rule ref="Squiz.Operators.ValidLogicalOperators"/>
<!-- <!– There MUST be one whitespace after a type casting operator. –>-->
<!-- <rule ref="Generic.Formatting.SpaceAfterCast"/>-->
<!-- <!– There MUST be one whitespace after unary not. –>-->
<!-- <rule ref="Generic.Formatting.SpaceAfterNot"/>-->
<!-- Inherited variables passed via `use` MUST be used in closures. -->
<rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure"/>
<!-- <rule ref="PEAR.Commenting.InlineComment"/>-->
<!-- <rule ref="SlevomatCodingStandard.Commenting.EmptyComment"/>-->
<!-- <rule ref="Squiz.Commenting.FunctionComment">-->
<!-- <!– Allow `@throws` without description –>-->
<!-- <exclude name="Squiz.Commenting.FunctionComment.EmptyThrows"/>-->
<!-- <!– Does not work properly with PHP 7 / short-named types –>-->
<!-- <exclude name="Squiz.Commenting.FunctionComment.IncorrectParamVarName"/>-->
<!-- <!– Does not support collections, i.e. `string[]` –>-->
<!-- <exclude name="Squiz.Commenting.FunctionComment.IncorrectTypeHint"/>-->
<!-- <!– Forces incorrect types –>-->
<!-- <exclude name="Squiz.Commenting.FunctionComment.InvalidReturn"/>-->
<!-- <!– Breaks with compound return types, i.e. `string|null` –>-->
<!-- <exclude name="Squiz.Commenting.FunctionComment.InvalidReturnNotVoid"/>-->
<!-- <!– Breaks when all params are not documented –>-->
<!-- <exclude name="Squiz.Commenting.FunctionComment.InvalidTypeHint"/>-->
<!-- <!– Doc comment is not required for every method –>-->
<!-- <exclude name="Squiz.Commenting.FunctionComment.Missing"/>-->
<!-- <!– Do not require comments for `@param` –>-->
<!-- <exclude name="Squiz.Commenting.FunctionComment.MissingParamComment"/>-->
<!-- <!– Do not require `@param` for all parameters –>-->
<!-- <exclude name="Squiz.Commenting.FunctionComment.MissingParamTag"/>-->
<!-- <!– Do not require `@return` for void methods –>-->
<!-- <exclude name="Squiz.Commenting.FunctionComment.MissingReturn"/>-->
<!-- <!– Comments don't have to be sentences –>-->
<!-- <exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop"/>-->
<!-- <!– Comments don't have to be sentences –>-->
<!-- <exclude name="Squiz.Commenting.FunctionComment.ParamCommentNotCapital"/>-->
<!-- <!– Breaks when all params are not documented –>-->
<!-- <exclude name="Squiz.Commenting.FunctionComment.ParamNameNoMatch"/>-->
<!-- <!– Doesn't respect inheritance –>-->
<!-- <exclude name="Squiz.Commenting.FunctionComment.ScalarTypeHintMissing"/>-->
<!-- <!– Throws comments can start without a capital and doesn't need a full stop –>-->
<!-- <exclude name="PEAR.Commenting.FunctionComment.ThrowsNoFullStop"/>-->
<!-- <exclude name="PEAR.Commenting.FunctionComment.ThrowsNotCapital"/>-->
<!-- <!– Doesn't work with self as typehint –>-->
<!-- <exclude name="Squiz.Commenting.FunctionComment.TypeHintMissing"/>-->
<!-- </rule>-->
<!-- DocBlocks and comments SHOULD NOT be used for already typehinted arguments,
except arrays. -->
<rule ref="WebimpressCodingStandard.Functions.Param">
<exclude name="WebimpressCodingStandard.Functions.Param.MissingSpecification"/>
<exclude name="WebimpressCodingStandard.Functions.Param.RedundantParamDoc"/>
</rule>
<rule ref="WebimpressCodingStandard.Functions.ReturnType">
<exclude name="WebimpressCodingStandard.Functions.ReturnType.ReturnValue"/>
<exclude name="WebimpressCodingStandard.Functions.ReturnType.RedundantReturnDoc"/>
</rule>
<!-- <rule ref="WebimpressCodingStandard.Commenting.TagWithType">-->
<!-- необходимо исключение для шаблонов -->
<!-- <exclude name="WebimpressCodingStandard.Commenting.TagWithType.InvalidOrder"/>-->
<!-- </rule>-->
<!-- The asterisks in a DocBlock should align, and there should be one
space between the asterisk and tag. -->
<rule ref="Squiz.Commenting.DocCommentAlignment">
<exclude name="Squiz.Commenting.DocCommentAlignment.SpaceAfterStar"/>
</rule>
<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing">
<properties>
<property name="linesCountBeforeFirstContent" value="0"/>
<property name="linesCountAfterLastContent" value="0"/>
<property name="linesCountBetweenDescriptionAndAnnotations" value="1"/>
<property name="linesCountBetweenAnnotationsGroups" value="1"/>
<property name="annotationsGroups" type="array">
<element value="
@internal,
@deprecated
"/>
<element value="
@link,
@uses,
@see,
@copyright,
@license
"/>
<element value="
@ORM\,
@ODM\,
@PHPCR\,
@OA\
"/>
<element value="
@param\,
@return\,
@throws\
"/>
</property>
</properties>
</rule>
<!-- The words _private_, _protected_, _static_, _constructor_, _deconstructor_,
_Created by_, _getter_ and _setter_, MUST NOT be used in comments. -->
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenComments">
<properties>
<property name="forbiddenCommentPatterns" type="array">
<element value="~^(?:(?!private|protected|static)\S+ )?(?:con|de)structor\.\z~i"/>
<element value="~^Created by .+\.\z~i"/>
<element value="~^(User|Date|Time): \S+\z~i"/>
<element value="~^\S+ [gs]etter\.\z~i"/>
<element value="~^Class \S+\z~i"/>
</property>
</properties>
</rule>
<!-- Heredoc and nowdoc tags MUST be uppercase without spaces. -->
<rule ref="WebimpressCodingStandard.Formatting.Heredoc"/>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing">
<properties>
<property name="spacesCountBeforeColon" value="0"/>
</properties>
</rule>
<rule ref="Generic.WhiteSpace.ScopeIndent"/>
<rule ref="PSR2.Methods.FunctionCallSignature.Indent"/>
<rule ref="PSR2.Methods.FunctionCallSignature.OpeningIndent"/>
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent"/>
<!-- Variable names MUST be declared in camelCase. -->
<rule ref="WebimpressCodingStandard.NamingConventions.ValidVariableName">
<exclude-pattern>src/Model/*</exclude-pattern>
</rule>
<!-- Property name "$_rateTime" should not be prefixed with an underscore to indicate visibility -->
<rule ref="PSR2.Classes.PropertyDeclaration.Underscore"/>
<!-- Visibility must be declared on all constants if your project supports PHP 7.1 or later -->
<rule ref="PSR12.Properties.ConstantVisibility.NotFound"/>
<!-- Return type is "self" so return tag must be one of: "self", "static" or "$this" -->
<rule ref="WebimpressCodingStandard.Functions.ReturnType.ReturnArray"/>
<!-- Return type in PHPDoc tag is different than declared type in method declaration: "mixed" and "string" -->
<rule ref="WebimpressCodingStandard.Functions.ReturnType.DifferentTagAndDeclaration"/>
<!-- Unexpected type "string" found in return tag -->
<rule ref="WebimpressCodingStandard.Functions.ReturnType.ReturnComplexType"/>
<!-- Function return type is array nor iterable, but function returns array here -->
<rule ref="WebimpressCodingStandard.Functions.ReturnType.ReturnArray"/>
<!-- Function returns only array, but return type contains not array types: false -->
<rule ref="WebimpressCodingStandard.Functions.ReturnType.ReturnArrayOnly"/>
<rule ref="WebimpressCodingStandard.Functions.ReturnType.ReturnSelf"/>
<!-- Function returns only new instance of PaymentRouteResult, but return type is not only PaymentRouteResult -->
<rule ref="WebimpressCodingStandard.Functions.ReturnType.ReturnNewInstanceOnly"/>
<!-- Return type contains "mixed" which is not an array type -->
<rule ref="WebimpressCodingStandard.Functions.ReturnType.NotArrayType"/>
<!-- Return type of "getDefaultPaymentRouteResult" function is not void, but function has no return statement -->
<rule ref="WebimpressCodingStandard.Functions.ReturnType.InvalidNoReturn"/>
<!-- Invalid type "string" for parameter $merchantValidationForm -->
<rule ref="WebimpressCodingStandard.Functions.Param.ParamDocInvalidType">
</rule>
<!-- Parameter $form has not been found in function declaration -->
<rule ref="WebimpressCodingStandard.Functions.Param"/>
<!-- String concat is not required here; use a single string instead -->
<rule ref="Generic.Strings.UnnecessaryStringConcat"/>
<!-- Function returns only boolean true, but return type is not only true -->
<rule ref="WebimpressCodingStandard.Functions.ReturnType"/>
<!-- Arguments with default values must be at the end of the argument list -->
<rule ref="PEAR.Functions.ValidDefaultValue"/>
<!-- Closing brace of array declaration must be on a new line -->
<rule ref="Generic.Arrays.ArrayIndent.CloseBraceNotNewLine"/>
<!-- Multi-line arrays must have a trailing comma after the last element -->
<rule ref="WebimpressCodingStandard.Arrays.TrailingArrayComma.MissingTrailingComma"/>
<!-- String "kartik\grid\Module" contains class reference, use ::class instead -->
<rule ref="WebimpressCodingStandard.Formatting.StringClassReference"/>
<!-- A double colon must not be followed by a whitespace -->
<rule ref="WebimpressCodingStandard.Formatting.DoubleColon"/>
<!-- Parentheses around expression "self::LIST_TYPE_ACTIVE" are redundant -->
<rule ref="WebimpressCodingStandard.Formatting.RedundantParentheses"/>
<!-- There must be exactly 1 space(s) between the closing parenthesis and the colon when declaring a return type for a function -->
<rule ref="WebimpressCodingStandard.Formatting.ReturnType.SpacesBeforeColon">
<exclude name="WebimpressCodingStandard.Formatting.ReturnType.SpacesBeforeColon"/>
</rule>
<!-- There must be one array element per line -->
<rule ref="WebimpressCodingStandard.Arrays.Format"/>
<!-- Unexpected space after reference character -->
<rule ref="WebimpressCodingStandard.Formatting"/>
<rule ref="PSR1.Files.SideEffects"/>
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<exclude-pattern>m\d{6}_\d{6}_.+\.php$</exclude-pattern>
</rule>
<!-- Ignore camel caps format for class name of migrations -->
<rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
<exclude-pattern>m\d{6}_\d{6}_.+\.php$</exclude-pattern>
</rule>
<!-- Ignore no camel caps format for methods name -->
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<exclude-pattern>*</exclude-pattern>
</rule>
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>tests/*</exclude-pattern>
<rule ref="PSR2.Methods.MethodDeclaration.Underscore">
<exclude-pattern>*/tests/unit/*</exclude-pattern>
</rule>
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols"/>
<!-- File appears to be minified and cannot be processed -->
<exclude-pattern>*.js</exclude-pattern>
<exclude-pattern>*.css</exclude-pattern>
<exclude-pattern>*.json</exclude-pattern>
<exclude-pattern>*.json</exclude-pattern>
<exclude-pattern>/_my/*</exclude-pattern>
<exclude-pattern>/_design/*</exclude-pattern>
<exclude-pattern>/_temp/*</exclude-pattern>
<exclude-pattern>/_vendors/*</exclude-pattern>
<exclude-pattern>/_vendors/*</exclude-pattern>
<exclude-pattern>/wep/_vendors/*</exclude-pattern>
</ruleset>