Skip to content

Commit

Permalink
easy-coding-standard applied
Browse files Browse the repository at this point in the history
  • Loading branch information
abuenosvinos committed Dec 20, 2023
1 parent 1f03d53 commit 9803180
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ static-analysis:
# docker exec -w /var/www/html/ -t --user $(id -u):$(id -g) $(PHP_CONTAINER) ./vendor/bin/psalm --output-format=github --shepherd
docker exec -w /var/www/html/ -t --user $(id -u):$(id -g) $(PHP_CONTAINER) ./vendor/bin/psalm --shepherd --show-info=true

lint:
docker exec -w /var/www/html/ -t --user $(id -u):$(id -g) $(PHP_CONTAINER) ./vendor/bin/ecs check

clean-cache: ## Clear the cache
@rm -rf apps/*/*/var
@docker exec -w /var/www/html/ -t --user $(id -u):$(id -g) $(PHP_CONTAINER) ./bin/console cache:warmup
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"symfony/phpunit-bridge": "^6.2",
"symfony/stopwatch": "6.2.*",
"symfony/web-profiler-bundle": "6.2.*",
"symplify/easy-coding-standard": "^12.0",
"vimeo/psalm": "^5.18"
},
"config": {
Expand Down
60 changes: 59 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

return function (ECSConfig $ecsConfig): void {
$ecsConfig->paths([
__DIR__ . '/config',
__DIR__ . '/public',
__DIR__ . '/src',
__DIR__ . '/tests',
]);

// this way you add a single rule
$ecsConfig->rules([
NoUnusedImportsFixer::class,
]);

// this way you can add sets - group of rules
$ecsConfig->sets([
// run and fix, one by one
// SetList::SPACES,
// SetList::ARRAY,
// SetList::DOCBLOCK,
// SetList::NAMESPACES,
// SetList::COMMENTS,
// SetList::PSR_12,
]);
};

0 comments on commit 9803180

Please sign in to comment.