Skip to content
PHP hard mode
Branch: master
Clone or download
Latest commit e7131f4 Feb 26, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
HardMode Do not align comments Feb 20, 2019
.gitignore First commit Feb 20, 2019
LICENSE First commit Feb 20, 2019
README.md Update README.md Feb 26, 2019
composer.json Set the type so that it works with https://github.com/Dealerdirect/ph… Feb 20, 2019

README.md

Usage

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.

You can’t perform that action at this time.