PHPackages                             bolt/codingstyle - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. bolt/codingstyle

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bolt/codingstyle
================

Coding style for Bolt projects

v1.0.5(9y ago)258.9k↑200%23MITPHP

Since Apr 11Pushed 7y ago13 watchersCompare

[ Source](https://github.com/bolt/codingstyle)[ Packagist](https://packagist.org/packages/bolt/codingstyle)[ RSS](/packages/bolt-codingstyle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (9)Used By (3)

Bolt coding style standard
==========================

[](#bolt-coding-style-standard)

PHP
---

[](#php)

[Bolt](https://github.com/bolt) tries to adhere a coding style based on PSR-2 and the Symfony2 coding standard.

### [CodeSniffer](http://pear.php.net/package/PHP_CodeSniffer)

[](#codesniffer)

To use run:

```
composer require bolt/codingstyle squizlabs/php_codesniffer escapestudios/symfony2-coding-standard:^3.0@dev --dev

```

Add a `global` before `require` if you want to install it globally.

If installing globally you also need to configure the `installed_paths`:

```
phpcs --config-set installed_paths "$(composer config --global data-dir)"

```

Then create a CodeSniffer config file named `phpcs.xml.dist` in your project root:

```

    src
    tests

```

Additional changes can be made here. See [CodeSniffer's annotated ruleset](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml) for more information.

`phpcs.xml.dist` should be committed for all developers to use.
An `phpcs.xml` file can also be create which takes precedence over `phpcs.xml.dist` for local changes. This file should be ignored from git.

### [Code Fixer](http://cs.sensiolabs.org)

[](#code-fixer)

To use run:

```
composer require bolt/codingstyle friendsofphp/php-cs-fixer --dev
```

Add a `global` before `require` if you want to install it globally.

Then create a config file named `.php_cs.dist` in your project root:

```
