Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/projektmotor/symfony-coding-standard
Symfony coding standards for ProjektMOTOR enriched by several useful rules
https://github.com/projektmotor/symfony-coding-standard
code-sniffer coding-standard phpcbf phpcs symfony
Last synced: 28 days ago
JSON representation
Symfony coding standards for ProjektMOTOR enriched by several useful rules
- Host: GitHub
- URL: https://github.com/projektmotor/symfony-coding-standard
- Owner: projektmotor
- License: mit
- Created: 2019-02-26T09:52:07.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-31T13:21:33.000Z (over 1 year ago)
- Last Synced: 2024-11-22T17:31:53.106Z (about 1 month ago)
- Topics: code-sniffer, coding-standard, phpcbf, phpcs, symfony
- Size: 31.3 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Symfony coding standard of ProjektMOTOR
Symfony coding standards for ProjektMOTOR enriched by several useful rules.We at ProjektMOTOR :heart: clean code. So we have a have an internal PHP coding standard based on
symfony coding standard
used for all our projects. We are using [PHP CodeSniffer][1] with the great [Symfony PHP CodeSniffer Coding Standard
of djoos][2] and some sniffs of [Slevomat Coding Standard][3], both adopted to our own needs.## Goals of our coding standard
* Using already existing standards (PSR-1, PSR-2, Symfony).
* Coding standard can be used across different projects.
* Avoid duplications (also between code, CVS history and documentation).
* Ensure code quality across different dev setups (e.g. different IDEs).## Installation
If you use [Composer][4], you can install ProjektMOTOR Coding Standard in your project with the following
command:```BASH
composer require --dev projektmotor/symfony-coding-standard
```Optional: To install coding standard automatically edit your composer script:
```JSON
scripts: {
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
],
"auto-scripts": {
"phpcs --config-set installed_paths vendor/projektmotor/symfony-coding-standard/ProjektMOTORCodingStandard/": "script",
}
}
```## Usage
Just create a `phpcs.xml.dist` in your project's root directory with the following content:
```xml
```
And then you can execute the CodeSniffer like this:
vendor/bin/phpcs -s -p --colors src/
---
[1]: https://github.com/squizlabs/PHP_CodeSniffer#readme
[2]: https://github.com/djoos/Symfony-coding-standard
[3]: https://github.com/slevomat/coding-standard
[4]: https://getcomposer.org/