Skip to content

Commit 536b5d5

Browse files
committed
installed php cs fixer
1 parent 6e531a6 commit 536b5d5

File tree

2 files changed

+65
-2
lines changed

2 files changed

+65
-2
lines changed

.php-cs-fixer.dist.php

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file is part of the Neo4j PHP Client and Driver package.
7+
*
8+
* (c) Nagels <https://nagels.tech>
9+
*
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
12+
*/
13+
14+
use PhpCsFixer\Config;
15+
use PhpCsFixerCustomFixers\Fixer\ConstructorEmptyBracesFixer;
16+
use PhpCsFixerCustomFixers\Fixer\IssetToArrayKeyExistsFixer;
17+
use PhpCsFixerCustomFixers\Fixer\MultilineCommentOpeningClosingAloneFixer;
18+
use PhpCsFixerCustomFixers\Fixer\MultilinePromotedPropertiesFixer;
19+
use PhpCsFixerCustomFixers\Fixer\PhpdocNoSuperfluousParamFixer;
20+
use PhpCsFixerCustomFixers\Fixer\PhpdocParamOrderFixer;
21+
use PhpCsFixerCustomFixers\Fixer\PhpUnitAssertArgumentsOrderFixer;
22+
use PhpCsFixerCustomFixers\Fixer\StringableInterfaceFixer;
23+
24+
try {
25+
$finder = PhpCsFixer\Finder::create()
26+
->in(__DIR__.'/src')
27+
->in(__DIR__.'/tests');
28+
} catch (Throwable $e) {
29+
echo $e->getMessage()."\n";
30+
31+
exit(1);
32+
}
33+
34+
return (new Config())
35+
->setRiskyAllowed(true)
36+
->setRules([
37+
'@Symfony' => true,
38+
39+
'array_syntax' => ['syntax' => 'short'],
40+
'linebreak_after_opening_tag' => true,
41+
'ordered_imports' => true,
42+
'phpdoc_order' => true,
43+
'phpdoc_to_comment' => false,
44+
'yoda_style' => false,
45+
'declare_strict_types' => true,
46+
'global_namespace_import' => [
47+
'import_classes' => true,
48+
'import_constants' => true,
49+
'import_functions' => true,
50+
],
51+
ConstructorEmptyBracesFixer::name() => true,
52+
IssetToArrayKeyExistsFixer::name() => true,
53+
MultilineCommentOpeningClosingAloneFixer::name() => true,
54+
MultilinePromotedPropertiesFixer::name() => true,
55+
PhpUnitAssertArgumentsOrderFixer::name() => true,
56+
PhpdocNoSuperfluousParamFixer::name() => true,
57+
PhpdocParamOrderFixer::name() => true,
58+
StringableInterfaceFixer::name() => true,
59+
])
60+
->setFinder($finder)
61+
->registerCustomFixers(new PhpCsFixerCustomFixers\Fixers())
62+
;

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"symfony/config": "^6.0"
2828
},
2929
"require-dev": {
30-
"friendsofphp/php-cs-fixer": "^3.2",
3130
"matthiasnoback/symfony-dependency-injection-test": "^4.3",
3231
"phpunit/phpunit": "^9.5",
3332
"psalm/plugin-symfony": "^5.0",
@@ -36,7 +35,9 @@
3635
"symfony/http-kernel": "^6.2",
3736
"symfony/test-pack": "^1.1",
3837
"symfony/yaml": "^6.2",
39-
"vimeo/psalm": "^5.12"
38+
"vimeo/psalm": "^5.12",
39+
"kubawerlos/php-cs-fixer-custom-fixers": "^3.0",
40+
"friendsofphp/php-cs-fixer": "^3.0"
4041
},
4142
"autoload": {
4243
"psr-4": {

0 commit comments

Comments
 (0)