https://github.com/codelytv/php-coding_style-codely
PHP Coding Style rules we use in Codely
https://github.com/codelytv/php-coding_style-codely
coding-style easy-coding-standard php php-cs-fixer phpcs
Last synced: 9 months ago
JSON representation
PHP Coding Style rules we use in Codely
- Host: GitHub
- URL: https://github.com/codelytv/php-coding_style-codely
- Owner: CodelyTV
- License: agpl-3.0
- Created: 2023-10-19T14:26:17.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-05T14:18:15.000Z (over 1 year ago)
- Last Synced: 2025-03-26T08:03:32.374Z (10 months ago)
- Topics: coding-style, easy-coding-standard, php, php-cs-fixer, phpcs
- Language: PHP
- Homepage: https://packagist.org/packages/codelytv/coding-style
- Size: 23.4 KB
- Stars: 53
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
✍️ Codely's Easy Coding Standards configuration
Opinionated linting configuration considering modern PHP best practices and providing consistency. 👌
Take a look, play and have fun with this.
Stars are welcome 😊
## 👀 How to use
1. Install the dependency
```sh
composer require --dev codelytv/coding-style
```
2. Add it to your `ecs.php` file:
```php
use CodelyTv\CodingStyle;
use Symplify\EasyCodingStandard\Config\ECSConfig;
return function (ECSConfig $ecsConfig): void {
$ecsConfig->paths([__DIR__ . '/src',]);
$ecsConfig->sets([CodingStyle::DEFAULT]);
// Or this if you prefer to have the code aligned
// $ecsConfig->sets([CodingStyle::ALIGNED]);
};
```
3. Execute it:
```sh
./vendor/bin/ecs check
```
## 🤔 What it does
- Lints PHP using PSR-12
- Extends some config (you can see all the rules [here](src/coding_style.php))
- Use tabs to indent ([reason](https://www.youtube.com/watch?v=yD2T42zsP7c)). If you want to use spaces, you can add the
following line at the end of your `ecs.php`:
```php
use Symplify\EasyCodingStandard\ValueObject\Option;
$ecsConfig->indentation(Option::INDENTATION_SPACES);
```
## 📦 How to release a new version
Simply create a new [GitHub Release](https://github.com/CodelyTV/php-coding_style-codely/releases/new) following
semantic versioning.
## 👌 Codely Code Quality Standards
Publishing this package we are committing ourselves to the following code quality standards:
- 🤝 Respect **Semantic Versioning**: No breaking changes in patch or minor versions
- 🤏 No surprises in transitive dependencies: Use the **bare minimum dependencies** needed to meet the purpose
- 🎯 **One specific purpose** to meet without having to carry a bunch of unnecessary other utilities
- 📖 **Well documented Readme** showing how to install and use
- ⚖️ **License favoring Open Source** and collaboration