mnapoli/hard-mode

Hard mode for PHP

Installs: 25 492

Dependents: 21

Suggesters: 0

Security: 0

Stars: 8

Watchers: 3

Forks: 1

Open Issues: 0

Type:phpcodesniffer-standard

0.3.0 2020-10-12 07:54 UTC

This package is auto-updated.

Last update: 2024-12-12 17:24:03 UTC


README

composer require --dev mnapoli/hard-mode

Then write a .phpcs.xml.dist file:

<?xml version="1.0"?>
<ruleset>
    <arg name="basepath" value="."/>

    <file>src</file>
    <file>tests</file>

    <rule ref="HardMode"/>
</ruleset>

Then run the analysis:

vendor/bin/phpcs

Or using pretty:

vendor/bin/pretty

Fixing errors

Run:

vendor/bin/phpcbf

Or using pretty:

vendor/bin/pretty fix

Advanced configuration

Check out the PHP CodeSniffer documentation for all the options. You will find below documentation for common scenarios.

To exclude some files from the analysis:

<exclude-pattern>tests/Fixtures</exclude-pattern>

On large projects you may want to use PHP CodeSniffer's cache:

<arg name="cache" value=".phpcs-cache"/>

Remember to add .phpcs-cache to .gitignore.