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 962964d commit 5bb2ca4
Show file tree
Hide file tree
Showing 23 changed files with 54 additions and 47 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"require-dev": {
"bnf/phpstan-psr-container": "^1.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",
"overtrue/phplint": "^9.0",
Expand All @@ -44,10 +44,10 @@
"phpunit/phpunit": "^9.6.13|^10.4",
"povils/phpmnd": "^3.2",
"roave/security-advisories": "dev-master",
"symfony/console": "^6.0"
"symfony/console": "^6.0|^7.0"
},
"suggest": {
"symfony/console": "In order to use console commands (>=5.1)"
"symfony/console": "In order to use console commands (>=6.0)"
},
"autoload": {
"psr-4": {
Expand Down
53 changes: 30 additions & 23 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/*
* (c) 2015-2023 Julián Gutiérrez <[email protected]>
* (c) 2015-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-php-di
Expand All @@ -13,29 +13,36 @@
use PhpCsFixer\Fixer\Basic\CurlyBracesPositionFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;

return static function (ECSConfig $ecsConfig): void {
$header = <<<'HEADER'
$skips = [];
if (\PHP_VERSION_ID < 80_100) {
$skips[CurlyBracesPositionFixer::class] = __DIR__ . '/src/CallableResolver.php';
}

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

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

$skipRules = [];
if (\PHP_VERSION_ID < 80_100) {
$skipRules[CurlyBracesPositionFixer::class] = __DIR__ . '/src/CallableResolver.php';
}

(new ConfigSet80())
->setHeader($header)
->enablePhpUnitRules()
->setAdditionalSkips($skipRules)
->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/AbstractCompiledContainer.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

0 comments on commit 5bb2ca4

Please sign in to comment.