1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00
psalm/phpcs.xml
rarila bc11b10d9b
Beautified phpcs.xml (#7041)
Co-authored-by: ralila <>
2021-12-01 23:46:10 +02:00

122 lines
5.7 KiB
XML

<?xml version="1.0"?>
<ruleset
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd"
name="Psalm coding standard"
>
<description>The coding standard for Psalm.</description>
<!-- **************************************************************************************************************
* Configuration *
************************************************************************************************************** -->
<config name="installed_paths" value="../../slevomat/coding-standard"/>
<arg name="basepath" value="."/>
<!-- **************************************************************************************************************
* Files to include/exclude *
************************************************************************************************************** -->
<file>bin/</file>
<file>src/</file>
<file>tests/</file>
<exclude-pattern>src/Psalm/Internal/Visitor/SimpleNameResolver.php</exclude-pattern>
<!-- These are just examples and stub classes/files, so it doesn't really matter if they're PSR-2 compliant. -->
<exclude-pattern>src/Psalm/Internal/Stubs/</exclude-pattern>
<exclude-pattern>tests/fixtures/</exclude-pattern>
<!-- **************************************************************************************************************
* STANDARD: Generic *
************************************************************************************************************** -->
<!--
Restrict line length.
https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Generic/Docs/Files/LineLengthStandard.xml
-->
<rule ref="Generic.Files.LineLength">
<exclude-pattern>tests</exclude-pattern>
<exclude-pattern>src/Psalm/Internal/Type/TemplateStandinTypeReplacer.php</exclude-pattern>
</rule>
<!-- **************************************************************************************************************
* STANDARD: PSR2 *
************************************************************************************************************** -->
<rule ref="PSR2"/>
<!--
Namespace Declarations.
https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/PSR2/Docs/Namespaces/UseDeclarationStandard.xml
-->
<rule ref="PSR2.Namespaces.UseDeclaration">
<exclude-pattern>*</exclude-pattern>
</rule>
<!-- **************************************************************************************************************
* STANDARD: Squiz *
************************************************************************************************************** -->
<!--
The self keyword should be used instead of the current class name.
https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Squiz/Docs/Classes/SelfMemberReferenceStandard.xml
-->
<rule ref="Squiz.Classes.SelfMemberReference"/>
<!-- **************************************************************************************************************
* STANDARD: SlevomatCodingStandard *
************************************************************************************************************** -->
<!--
Handle imports from namespaces.
https://github.com/slevomat/coding-standard#slevomatcodingstandardnamespacesreferenceusednamesonly-
-->
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
<properties>
<property name="allowFallbackGlobalConstants" value="false"/>
<property name="allowFallbackGlobalFunctions" value="false"/>
<property name="allowFullyQualifiedGlobalConstants" value="true"/>
<property name="allowFullyQualifiedGlobalFunctions" value="true"/>
<property name="allowFullyQualifiedGlobalClasses" value="true"/>
</properties>
<exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName"/>
</rule>
<!--
Looks for unused imports from other namespaces.
https://github.com/slevomat/coding-standard#slevomatcodingstandardnamespacesunuseduses-
-->
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" value="true"/>
</properties>
</rule>
<!--
Checks whether uses at the top of a file are alphabetically sorted.
https://github.com/slevomat/coding-standard#slevomatcodingstandardnamespacesalphabeticallysorteduses-
-->
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses">
<properties>
<property name="caseSensitive" value="true"/>
</properties>
</rule>
<!--
Enforces configurable number of lines before/after/between use.
https://github.com/slevomat/coding-standard#slevomatcodingstandardnamespacesusespacing-
-->
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing">
<properties>
<property name="linesCountBetweenUseTypes" value="1"/>
</properties>
</rule>
</ruleset>