Skip to content

Commit

Permalink
update ecs config and notice
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangut committed Feb 2, 2024
1 parent 90ac65e commit 9b74d98
Show file tree
Hide file tree
Showing 111 changed files with 160 additions and 144 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"ext-json": "*",
"doctrine/annotations": "^2.0",
"infection/infection": "~0.25|~0.27",
"juliangut/easy-coding-standard-config": "^1.12",
"juliangut/easy-coding-standard-config": "^1.14",
"juliangut/phpstan-config": "^1.1",
"laminas/laminas-diactoros": "^3.2",
"mikey179/vfsstream": "^1.6",
Expand Down
84 changes: 50 additions & 34 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand All @@ -11,44 +11,60 @@

use Jgut\ECS\Config\ConfigSet80;
use PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\NoSilencedErrorsSniff;
use PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer;
use PhpCsFixerCustomFixers\Fixer\NoNullableBooleanTypeFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;

return static function (ECSConfig $ecsConfig): void {
$header = <<<'HEADER'
$skips = [
NoSilencedErrorsSniff::class . '.Forbidden' => [
__DIR__ . '/src/Configuration.php',
__DIR__ . '/src/Route/RouteResolver.php',
__DIR__ . '/src/Mapping/Annotation/Router.php',
],
NoNullableBooleanTypeFixer::class => __DIR__ . '/src/Mapping/Attribute/Route.php',
];
if (\PHP_VERSION_ID < 80_100) {
$skips = array_merge(
$skips,
[
PhpdocAlignFixer::class => [
__DIR__ . '/src/Route/Route.php',
__DIR__ . '/src/RouteCollector.php',
],
MethodArgumentSpaceFixer::class => [
__DIR__ . '/src/Mapping/Attribute/Group.php',
__DIR__ . '/src/Mapping/Attribute/Route.php',
],
],
);
}

$configSet = (new ConfigSet80())
->setHeader(<<<'HEADER'
(c) 2017-{{year}} Julián Gutiérrez <[email protected]>
@license BSD-3-Clause
@link https://github.com/juliangut/slim-routing
HEADER;

$ecsConfig->paths([
__FILE__,
__DIR__ . '/src',
__DIR__ . '/tests',
]);
$ecsConfig->cacheDirectory('.ecs.cache');

$skips = [
NoSilencedErrorsSniff::class . '.Forbidden' => [
__DIR__ . '/src/Configuration.php',
__DIR__ . '/src/Route/RouteResolver.php',
__DIR__ . '/src/Mapping/Annotation/Router.php',
],
NoNullableBooleanTypeFixer::class => __DIR__ . '/src/Mapping/Attribute/Route.php',
];

if (\PHP_VERSION_ID < 80_100) {
$skips[PhpdocAlignFixer::class] = [
__DIR__ . '/src/Route/Route.php',
__DIR__ . '/src/RouteCollector.php',
];
}

(new ConfigSet80())
->setHeader($header)
->enablePhpUnitRules()
->setAdditionalSkips($skips)
->configure($ecsConfig);
};
HEADER)
->enablePhpUnitRules()
->setAdditionalSkips($skips);
$paths = [
__FILE__,
__DIR__ . '/src',
__DIR__ . '/tests',
];

if (!method_exists(ECSConfig::class, 'configure')) {
return static function (ECSConfig $ecsConfig) use ($configSet, $paths): void {
$ecsConfig->paths($paths);
$ecsConfig->cacheDirectory('.ecs.cache');

$configSet->configure($ecsConfig);
};
}

return $configSet
->configureBuilder()
->withCache('.ecs.cache')
->withPaths($paths);
2 changes: 1 addition & 1 deletion src/AppFactory.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Configuration.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Console/AbstractRoutingCommand.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Console/ListCommand.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Console/MatchCommand.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Annotation/ArgumentTrait.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Annotation/Group.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Annotation/MiddlewareTrait.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Annotation/PathTrait.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Annotation/Route.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Annotation/Router.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Annotation/TransformerTrait.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Attribute/Group.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Attribute/Middleware.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Attribute/Route.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Attribute/Transformer.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Driver/AnnotationDriver.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Driver/AttributeDriver.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Driver/DriverFactory.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Driver/FileMappingTrait.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Driver/JsonDriver.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Driver/PhpDriver.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Driver/XmlDriver.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Driver/YamlDriver.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Metadata/AbstractMetadata.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Metadata/GroupMetadata.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Mapping/Metadata/RouteMetadata.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Naming/CamelCase.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Naming/Dot.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Naming/SnakeCase.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Naming/Strategy.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
2 changes: 1 addition & 1 deletion src/Response/AbstractResponse.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2017-2023 Julián Gutiérrez <[email protected]>
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-routing
Expand Down
Loading

0 comments on commit 9b74d98

Please sign in to comment.