Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/plumthedev/yii2-php-cs-fixer-config
PHP CS Fixer Config for Yii2 projects
https://github.com/plumthedev/yii2-php-cs-fixer-config
php php-cs php-cs-fixer php-cs-fixer-config php-cs-fixer-custom-fixers php-cs-fixer-ruleset php-framework php-library php5 php7 php71 php72 phpunit yii2 yii2-advanced yii2-basic yii2-framework yii2-modules
Last synced: 2 months ago
JSON representation
PHP CS Fixer Config for Yii2 projects
- Host: GitHub
- URL: https://github.com/plumthedev/yii2-php-cs-fixer-config
- Owner: plumthedev
- License: mit
- Created: 2019-11-04T13:47:59.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-04T21:03:38.000Z (10 months ago)
- Last Synced: 2024-09-30T23:43:59.404Z (3 months ago)
- Topics: php, php-cs, php-cs-fixer, php-cs-fixer-config, php-cs-fixer-custom-fixers, php-cs-fixer-ruleset, php-framework, php-library, php5, php7, php71, php72, phpunit, yii2, yii2-advanced, yii2-basic, yii2-framework, yii2-modules
- Language: PHP
- Homepage: https://packagist.org/packages/plumthedev/yii2-php-cs-fixer-config
- Size: 38.1 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
# Dear Packagist maintainer, looks it is me plumthedev and I really really need your help! Could you change my email to [email protected]? Thanks in advance!
# Yii2 PHP CS Fixer Config
![Packagist downloads](https://img.shields.io/packagist/dt/plumthedev/yii2-php-cs-fixer-config?color=%238e44ad)
![GitHub license](https://img.shields.io/github/license/plumthedev/yii2-php-cs-fixer-config?color=%238e44ad)
![GitHub stars](https://img.shields.io/github/stars/plumthedev/yii2-php-cs-fixer-config?color=%238e44ad)PHP CS Fixer config for Yii2 projects. Contains [Config](src/Config.php) and [Finder](src/Finder.php) which excludes by default Yii2 app basic and advanced directories.
The ruleset is [grab from Yii 2 ecosystem](https://github.com/yiisoft/yii2/blob/master/cs/src/YiiConfig.php) and is automatically updated with it.## Installation
```shell script
$ composer require --dev plumthedev/yii2-php-cs-fixer-config
```## Usage
Create a configuration file `.php_cs` in the root of your project:```php
version}
HEADER;use plumthedev\PhpCsFixer\Config;
$csConfig = Config::create();
// CS Config setup
$csConfig->mergeRules([
'header_comment' => [
'header' => $projectHeader,
'commentType' => 'PHPDoc',
'separate' => 'bottom',
]
]);// CS Finder setup
$csConfigFinder = $csConfig->getFinder();
$csConfigFinder->in(__DIR__); // set current project directory
$csConfig->setFinder($csConfigFinder);return $csConfig;
```
## Running the tests
PHPUnit
```shell script
$ composer unit-tests
```PHP CS Fixer
```shell script
$ composer cs-fix
```## Contributing
This library is open source so if you want to contribute, you can.
>
Please submit bug reports, suggestions and pull requests to the [GitHub issue tracker](https://github.com/plumthedev/yii2-php-cs-fixer-config/issues).## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details