wikimedia/mediawiki-extensions-Wikibase

View on GitHub
repo/rest-api/ruleset.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0"?>
<ruleset name="rest-api">
    <!-- This is not a standalone ruleset, but an extension of Wikibase's main phpcs config.
        It is invoked separately to prevent the two rule sets from interfering with each other. -->

    <rule ref="Generic.PHP.RequireStrictTypes" />
    <rule ref="Generic.WhiteSpace.ScopeIndent" />
    <rule ref="Generic.Arrays.ArrayIndent" />
    <rule ref="PEAR.Functions.FunctionCallSignature.Indent" />
    <rule ref="Squiz.Strings.DoubleQuoteUsage">
        <exclude name="Squiz.Strings.DoubleQuoteUsage.ContainsVar" />
    </rule>
    <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
        <exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification" />
        <exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.UselessAnnotation" />
    </rule>
    <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
        <exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification" />
        <exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.UselessAnnotation" />
    </rule>
    <rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
        <exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification" />
    </rule>
    <rule ref="SlevomatCodingStandard.TypeHints.UselessConstantTypeHint" />
    <rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
        <properties>
            <property name="rootNamespaces" type="array">
                <element key="repo/rest-api/src" value="Wikibase\Repo\RestApi"/>
                <element key="repo/rest-api/tests/phpunit" value="Wikibase\Repo\Tests\RestApi"/>
                <element key="repo/rest-api/tests/architecture" value="Wikibase\Repo\Tests\RestApi\Architecture"/>
            </property>
        </properties>
    </rule>
    <rule ref="SlevomatCodingStandard.Functions.ArrowFunctionDeclaration">
        <properties>
            <property name="spacesCountAfterKeyword" value="0"/>
        </properties>
    </rule>

    <arg name="tab-width" value="4" />
    <arg name="extensions" value="php" />
    <exclude-pattern>node_modules/*</exclude-pattern>
</ruleset>