Skip to content

Commit fb76eba

Browse files
committed
Add php-cs-fixer as tool to project
Installed according to best practice in README of php-cs-fixer
1 parent b18cee6 commit fb76eba

4 files changed

Lines changed: 31 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ test_services.json
99
.idea
1010
.php_cs.cache
1111
.phpunit.result.cache
12+
.php-cs-fixer.cache
1213
atlassian-ide-plugin.xml
1314
aws-sdk-php.iml
1415
.DS_Store

.php-cs-fixer.dist.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->in([
5+
__DIR__ . '/src',
6+
__DIR__ . '/tests',
7+
])
8+
->exclude([
9+
'data'
10+
])
11+
;
12+
13+
return (new PhpCsFixer\Config())
14+
->setRules([
15+
'@PSR12' => true,
16+
'visibility_required' => [
17+
'elements' => [
18+
'property',
19+
'method',
20+
],
21+
]
22+
])
23+
->setFinder($finder)
24+
;

tools/php-cs-fixer/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.php-cs-fixer.cache

tools/php-cs-fixer/composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"require": {
3+
"friendsofphp/php-cs-fixer": "^3.8.0"
4+
}
5+
}

0 commit comments

Comments
 (0)