Skip to content

Commit 2d3066a

Browse files
committed
Add php-cs-fixer
1 parent 570bb4c commit 2d3066a

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/build
22
/vendor
3+
.php-cs-fixer.php
4+
.php-cs-fixer.cache
35
.phpunit.result.cache
46
composer.lock
57
composer.phar

.php-cs-fixer.dist.php

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
$finder = (new PhpCsFixer\Finder())
4+
->in(__DIR__);
5+
6+
return (new PhpCsFixer\Config())
7+
->setRiskyAllowed(true)
8+
->setRules([
9+
'@Symfony' => true,
10+
'@Symfony:risky' => true,
11+
'array_syntax' => [
12+
'syntax' => 'short',
13+
],
14+
'concat_space' => [
15+
'spacing' => 'one',
16+
],
17+
'declare_strict_types' => true,
18+
'global_namespace_import' => [
19+
'import_classes' => true,
20+
'import_constants' => null,
21+
'import_functions' => true,
22+
],
23+
'native_constant_invocation' => [
24+
'fix_built_in' => false,
25+
],
26+
'ordered_imports' => [
27+
'imports_order' => [
28+
'class',
29+
'function',
30+
'const',
31+
],
32+
],
33+
'single_line_throw' => false,
34+
])
35+
->setFinder($finder);

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"geo-io/interface": "2.x-dev"
1919
},
2020
"require-dev": {
21+
"friendsofphp/php-cs-fixer": "^3.1",
2122
"phpunit/phpunit": "^9.5"
2223
},
2324
"autoload": {

0 commit comments

Comments
 (0)