Skip to content

Commit 373fdeb

Browse files
committed
Replace ECS by php-cs-fixer
1 parent d1c650d commit 373fdeb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+142
-278
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ vendor
22
composer.lock
33
.phpunit.result.cache
44
.editorconfig
5+
.php-cs-fixer.cache

.php_cs.dist.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php declare(strict_types=1);
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->in(__DIR__ . '/src')
5+
->exclude(__DIR__ . '/tests')
6+
;
7+
8+
return (new PhpCsFixer\Config())
9+
->registerCustomFixers(new PhpCsFixerCustomFixers\Fixers())
10+
->setRiskyAllowed(true)
11+
->setRules([
12+
'@PSR12' => true,
13+
'@PSR12:risky' => true,
14+
'@Symfony' => true,
15+
'@Symfony:risky' => true,
16+
'linebreak_after_opening_tag' => true,
17+
'mb_str_functions' => true,
18+
'no_php4_constructor' => true,
19+
'no_unreachable_default_argument_value' => true,
20+
'no_useless_else' => true,
21+
'no_useless_return' => true,
22+
'php_unit_strict' => true,
23+
'phpdoc_order' => true,
24+
'strict_comparison' => true,
25+
'strict_param' => true,
26+
'concat_space' => false,
27+
'declare_strict_types' => true,
28+
'native_function_invocation' => ['include' => []],
29+
PhpCsFixerCustomFixers\Fixer\DeclareAfterOpeningTagFixer::name() => true,
30+
PhpCsFixerCustomFixers\Fixer\NoDoctrineMigrationsGeneratedCommentFixer::name() => true,
31+
PhpCsFixerCustomFixers\Fixer\NoImportFromGlobalNamespaceFixer::name() => true,
32+
PhpCsFixerCustomFixers\Fixer\PromotedConstructorPropertyFixer::name() => true,
33+
PhpCsFixerCustomFixers\Fixer\ConstructorEmptyBracesFixer::name() => true,
34+
PhpCsFixerCustomFixers\Fixer\MultilinePromotedPropertiesFixer::name() => true,
35+
PhpCsFixerCustomFixers\Fixer\NoUselessDoctrineRepositoryCommentFixer::name() => true,
36+
])
37+
->setFinder($finder)
38+
;

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@
3131
"symplify/easy-coding-standard": "^10.1"
3232
},
3333
"scripts": {
34-
"lint:fix": "./vendor/bin/ecs --fix --clear-cache --no-progress-bar",
34+
"lint:fix": "php tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --config=./.php_cs.dist.php",
3535
"lint:stan": "./vendor/bin/phpstan",
36-
"lint:upgrade": "vendor/bin/rector process",
37-
"lint": "composer lint:fix && composer lint:upgrade && composer lint:stan",
36+
"lint": "composer lint:fix && composer lint:stan",
3837
"test": "./vendor/bin/phpunit"
3938
},
4039
"extra": {

ecs.php

Lines changed: 0 additions & 14 deletions
This file was deleted.

rector.php

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/Aggregation/AbstractAggregation.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<?php
2-
3-
declare(strict_types=1);
1+
<?php declare(strict_types=1);
42

53
namespace Erichard\ElasticQueryBuilder\Aggregation;
64

src/Aggregation/Aggregation.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<?php
2-
3-
declare(strict_types=1);
1+
<?php declare(strict_types=1);
42

53
namespace Erichard\ElasticQueryBuilder\Aggregation;
64

src/Aggregation/CardinalityAggregation.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<?php
2-
3-
declare(strict_types=1);
1+
<?php declare(strict_types=1);
42

53
namespace Erichard\ElasticQueryBuilder\Aggregation;
64

src/Aggregation/DateHistogramAggregation.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<?php
2-
3-
declare(strict_types=1);
1+
<?php declare(strict_types=1);
42

53
namespace Erichard\ElasticQueryBuilder\Aggregation;
64

@@ -12,8 +10,8 @@
1210
*/
1311
class DateHistogramAggregation extends AbstractAggregation
1412
{
15-
use HasField;
16-
use HasExtendedBounds; // TODO enum
13+
use HasExtendedBounds;
14+
use HasField; // TODO enum
1715

1816
/**
1917
* @param array<AbstractAggregation> $aggregations

src/Aggregation/FilterAggregation.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<?php
2-
3-
declare(strict_types=1);
1+
<?php declare(strict_types=1);
42

53
namespace Erichard\ElasticQueryBuilder\Aggregation;
64

0 commit comments

Comments
 (0)