Skip to content

Commit

Permalink
run ecs
Browse files Browse the repository at this point in the history
  • Loading branch information
koertho committed Sep 19, 2024
1 parent 37984cd commit 42cab8f
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/ContaoManager/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@

class Plugin implements BundlePluginInterface, ConfigPluginInterface
{
/**
* @inheritDoc
*/
public function getBundles(ParserInterface $parser)
{
return [
Expand Down
5 changes: 2 additions & 3 deletions src/Controller/ContentElement/MemberListElementController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ class MemberListElementController extends AbstractContentElementController

public function __construct(
private readonly Connection $connection,
)
{
) {
}

protected function getResponse(Template $template, ContentModel $model, Request $request): Response
Expand All @@ -44,7 +43,7 @@ protected function getResponse(Template $template, ContentModel $model, Request
$total = $result->rowCount();
$limit = $model->perPage ?? 0;

$page = (int)$request->query->get('mlpage', 0);
$page = (int) $request->query->get('mlpage', 0);
if ($page < 1) {
$page = 1;
}
Expand Down
2 changes: 2 additions & 0 deletions tools/ecs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vendor
composer.lock
5 changes: 5 additions & 0 deletions tools/ecs/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"symplify/easy-coding-standard": "^12.1"
}
}
39 changes: 39 additions & 0 deletions tools/ecs/ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Fixer\Basic\BracesPositionFixer;
use PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer;
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
use PhpCsFixer\Fixer\Operator\ConcatSpaceFixer;
use PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer;
use PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer;
use PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer;
use PhpCsFixer\Fixer\Whitespace\TypeDeclarationSpacesFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;

return ECSConfig::configure()
->withPaths([
__DIR__ . '/../../src',
])

// add a single rule
->withRules([
NoUnusedImportsFixer::class,
BracesPositionFixer::class,
])

// add sets - group of rules
->withPreparedSets(
arrays: true,
namespaces: true,
spaces: true,
docblocks: true,
comments: true,
// psr12: true,
)
->withSkip([
NotOperatorWithSuccessorSpaceFixer::class
])

;

0 comments on commit 42cab8f

Please sign in to comment.