PHPackages                             camelot/coding-style - 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. camelot/coding-style

ActiveLibrary

camelot/coding-style
====================

Coding style for the Camelot project

v3.1.0(2y ago)01.9k↑1400%[1 PRs](https://github.com/CamelotProject/coding-style/pulls)7MITPHPPHP ^7.1 || ^8.0

Since Sep 22Pushed 2y ago1 watchersCompare

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

READMEChangelogDependencies (4)Versions (14)Used By (7)

Camelot coding style standard
=============================

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

PHP
---

[](#php)

[Camelot](https://github.com/CamelotProject) 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 camleot/codingstyle --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 camelot/codingstyle --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:

```
