-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ecs.php
45 lines (37 loc) · 1.1 KB
/
ecs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/*
* (c) 2017-2024 Julián Gutiérrez <[email protected]>
*
* @license BSD-3-Clause
* @link https://github.com/juliangut/slim-exception
*/
declare(strict_types=1);
use Jgut\ECS\Config\ConfigSet80;
use SlevomatCodingStandard\Sniffs\Exceptions\ReferenceThrowableOnlySniff;
use Symplify\EasyCodingStandard\Config\ECSConfig;
$configSet = (new ConfigSet80())
->setHeader(<<<'HEADER'
(c) 2017-{{year}} Julián Gutiérrez <[email protected]>
@license BSD-3-Clause
@link https://github.com/juliangut/slim-exception
HEADER)
->enablePhpUnitRules()
->setAdditionalSkips([
ReferenceThrowableOnlySniff::class . '.ReferencedGeneralException' => [
__DIR__ . '/src/ExceptionHandler.php',
],
]);
$paths = [
__FILE__,
__DIR__ . '/src',
__DIR__ . '/tests',
];
if (!method_exists(ECSConfig::class, 'configure')) {
return static function (ECSConfig $ecsConfig) use ($configSet, $paths): void {
$ecsConfig->paths($paths);
$configSet->configure($ecsConfig);
};
}
return $configSet
->configureBuilder()
->withPaths($paths);