Skip to content

Commit a2b0468

Browse files
author
n.gnato
committed
Rules optional, add readme
1 parent 3baaeaa commit a2b0468

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Набор правил php-cs-fixer для Студсервис
2+
3+
## Install
4+
5+
```shell
6+
composer require --dev studservis/php-cs-fixer-ruleset
7+
```
8+
9+
## Usage
10+
11+
```php
12+
<?php
13+
// .php-cs-fixer.dist.php
14+
15+
$finder = PhpCsFixer\Finder::create()
16+
->in([
17+
'./application/',
18+
'./tests/'
19+
);
20+
21+
$overridedProjectRules = [...];
22+
23+
return \StudService\PhpCsFixer\build_config($finder, $overridedProjectRules);
24+
```

composer.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
"name": "studservis/php-cs-fixer-ruleset",
3+
"authors": [
4+
{
5+
"name": "samizdam",
6+
"email": "[email protected]"
7+
}
8+
],
39
"description": "StudService shared PHP style rules for PHP-CS-Fixer",
410
"license": "MIT",
511
"require": {

src/config_builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use PhpCsFixer\Config;
66
use PhpCsFixer\ConfigInterface;
77

8-
function build_config(iterable $finder, array $rules): ConfigInterface
8+
function build_config(iterable $finder, array $rules = []): ConfigInterface
99
{
1010
$rules = array_merge(require __DIR__.'/rules.php', $rules);
1111

0 commit comments

Comments
 (0)