PHPackages                             altelma/cs-fixer - 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. altelma/cs-fixer

ActiveLibrary[Testing &amp; Quality](/categories/testing)

altelma/cs-fixer
================

php-cs-fixer with Github hook and config

v1.0.1(6y ago)1171PHP

Since Oct 18Pushed 6y ago1 watchersCompare

[ Source](https://github.com/ALTELMA/cs-fixer)[ Packagist](https://packagist.org/packages/altelma/cs-fixer)[ RSS](/packages/altelma-cs-fixer/feed)WikiDiscussions master Synced today

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

PHP Coding standard fixer
=========================

[](#php-coding-standard-fixer)

This package is based on  with addition of git pre-commit hook installation.

The hook will prevent the commit if the code does not comply with the coding standard rules

Default set of rules that are fully extendable

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

[](#installation)

#### Require a package

[](#require-a-package)

```
composer require --dev altelma/cs-fixer

```

#### Add composer init-hook command

[](#add-composer-init-hook-command)

```
"scripts": {
    "init-hook": "composer run-script post-install-cmd -d ./vendor/altelma/cs-fixer"
}

```

#### Install the git hook

[](#install-the-git-hook)

```
composer run-script init-hook

```

Manual Usage
------------

[](#manual-usage)

```
vendor/bin/cs-fixer help

```

**Note: Composer can install the binaries in custom dir instead of vendor/bin/ (sylius installs in bin/)**

Rules configuration
-------------------

[](#rules-configuration)

To override default rules add `.php_cs_rules.php` file in the root of the project

```
