PHPackages                             trayto-com/php-coding-standards - 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. trayto-com/php-coding-standards

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

trayto-com/php-coding-standards
===============================

Common coding-standard utils, tools and rules used across our PHP projects in trayto.com

v0.1.0(5y ago)265[1 PRs](https://github.com/trayto-com/php-coding-standards/pulls)MITPHP

Since Sep 29Pushed 5y ago1 watchersCompare

[ Source](https://github.com/trayto-com/php-coding-standards)[ Packagist](https://packagist.org/packages/trayto-com/php-coding-standards)[ Docs](https://trayto.com)[ RSS](/packages/trayto-com-php-coding-standards/feed)WikiDiscussions main Synced 6d ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

trayto.com | PHP Coding Standards
=================================

[](#traytocom--php-coding-standards)

Common coding-standard utils, tools and rules used across our PHP projects in trayto.com

[symplify/easy-coding-standard (ECS)](https://github.com/symplify/easy-coding-standard) is used under the hood. Follow configuration instructions there. Phar version is used so there should be no conflicts with projects dependencies.

[Parallel Lint](https://github.com/php-parallel-lint/PHP-Parallel-Lint) is available as well.

Further reading:

- [How to Migrate From PHP\_CodeSniffer to EasyCodingStandard in 7 Steps](https://tomasvotruba.com/blog/2018/06/04/how-to-migrate-from-php-code-sniffer-to-easy-coding-standard/#comment-4086561141)
- [How to Migrate From PHP CS Fixer to EasyCodingStandard in 6 Steps](https://tomasvotruba.com/blog/2018/06/07/how-to-migrate-from-php-cs-fixer-to-easy-coding-standard/)

Installation instructions
-------------------------

[](#installation-instructions)

```
composer require --dev trayto-com/php-coding-standards

```

Usage
-----

[](#usage)

You can use ECS directly in CLI but we do recommend to customise default rules:

```
vendor/bin/ecs check src tests --config vendor/trayto-com/php-coding-standards/definitions/ecs-default.php

```

Run PHP Parallel Lint:

```
vendor/bin/parallel-lint --exclude temp --exclude vendor .

```

*Hint:* do run linter before any other Standards check or Tests to fail fast in case of typo in your code

### Customise ECS rules and custom usage

[](#customise-ecs-rules-and-custom-usage)

Recommended is to create your own configuration for project and define cache folder for EasyCodingStandard as well.

Create php file in your project root, for example `ecs.php`:

```
