PHPackages                             happytech/phpcs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. happytech/phpcs

Abandoned → [friendsofphp/php-cs-fixer](/?search=friendsofphp%2Fphp-cs-fixer)ArchivedLibrary[Testing &amp; Quality](/categories/testing)

happytech/phpcs
===============

The Happy's PHP codesniffer convention.

1.0.4(8y ago)0251PHPPHP &gt;=5.1.2

Since Jan 24Pushed 8y ago10 watchersCompare

[ Source](https://github.com/Microclimat/phpcs)[ Packagist](https://packagist.org/packages/happytech/phpcs)[ RSS](/packages/happytech-phpcs/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (1)Versions (6)Used By (0)

About
-----

[](#about)

PHP\_CodeSniffer is a set of two PHP scripts; the main `phpcs` script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second `phpcbf` script to automatically correct coding standard violations. PHP\_CodeSniffer is an essential development tool that ensures your code remains clean and consistent.

Installation
------------

[](#installation)

1. Install [PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)
2. In command line, go inside the phpcs `Standards` directory

> Under Linux Mint, the path is `/usr/share/php/PHP/CodeSniffer/Standards/`

3. Checkout this repository

    ```
     git clone git@github.com:Microclimat/phpcs.git Happy

    ```
4. Check the installed coding standards for "Happy"

    ```
     phpcs -i

    ```
5. Set Happy like default standard

    ```
     phpcs --config-set default_standard Happy

    ```
6. Done!

Options - Not required but recommanded
--------------------------------------

[](#options---not-required-but-recommanded)

To use colors in output by default

```
    phpcs --config-set colors 1

```

Hiding warnings by default :

```
    phpcs --config-set show_warnings 0

```

Usage
-----

[](#usage)

Launch an analyse

```
    phpcs /path/to/code

```

Fixing Errors Automatically

```
    phpcbf /path/to/code

```

Ignoring

```
