mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 01:02:24 +01:00
Refactored the code in `src/Configuration` to include type declarations for method arguments and returned values. To make it easier to track what's left to do and to have a tool that prevents "regressions" in the future, PHP_CodeSniffer and Slevomat Coding Standard have been added. Next, a `phpcs.xml.dist` file has been created and configured to enforce type hints for methods. For the time being, only files in the src/Configuration directory are now being watched. To make it simpler to execute the checks, `lint` script has been added to `composer.json` to allow running checks with `composer lint`.
27 lines
1.2 KiB
XML
27 lines
1.2 KiB
XML
<?xml version="1.0"?>
|
|
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Deployer"
|
|
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
|
|
<config name="installed_paths" value="../../slevomat/coding-standard"/><!-- relative path from PHPCS source location -->
|
|
|
|
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
|
|
<properties>
|
|
<property name="newlinesCountBetweenOpenTagAndDeclare" value="0" />
|
|
<property name="newlinesCountAfterDeclare" value="1" />
|
|
<property name="spacesCountAroundEqualsSign" value="0" />
|
|
</properties>
|
|
</rule>
|
|
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
|
|
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification" />
|
|
</rule>
|
|
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
|
|
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification" />
|
|
</rule>
|
|
|
|
<file>src/Configuration</file>
|
|
|
|
<arg name="basepath" value="."/>
|
|
<arg name="colors"/>
|
|
<arg name="parallel" value="75"/>
|
|
<arg value="np"/>
|
|
</ruleset>
|