Skip to content

Commit b08c7c4

Browse files
committed
Update ECS
1 parent 4729366 commit b08c7c4

11 files changed

Lines changed: 20 additions & 18 deletions

File tree

composer.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,17 @@
2929
"provide": {
3030
"psr/log-implementation": "1.0 || 2.0 || 3.0"
3131
},
32-
3332
"require-dev": {
3433
"phpunit/phpunit": "^9",
3534
"symplify/easy-coding-standard": "^12"
3635
},
37-
3836
"autoload-dev": {
3937
"psr-4": {
4038
"Phlib\\Logger\\Test\\": "tests"
4139
}
4240
},
43-
4441
"scripts": {
45-
"cs-check": "phpcs --standard=PSR12 src/ tests/",
46-
"cs-fix": "phpcbf --standard=PSR12 src/ tests/"
42+
"check-cs": "vendor/bin/ecs check --ansi",
43+
"fix-cs": "vendor/bin/ecs check --fix --ansi"
4744
}
4845
}

ecs.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
__DIR__ . '/src',
1111
__DIR__ . '/tests',
1212
])
13+
->withRootFiles()
1314

1415
->withSets([
1516
SetList::COMMON,
@@ -23,13 +24,28 @@
2324

2425
// Remove sniff, from common/spaces
2526
\PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer::class,
27+
])
28+
29+
// Rule from common/spaces. No space after cast.
30+
->withConfiguredRule(
2631
\PhpCsFixer\Fixer\CastNotation\CastSpacesFixer::class,
32+
[
33+
'space' => 'none',
34+
],
35+
)
36+
37+
/*
38+
* Rule missing from PSR12. PER Coding Style 3:
39+
* "... each of the blocks [of import statements] MUST be separated by a single blank line ..."
40+
*/
41+
->withRules([
42+
\PhpCsFixer\Fixer\Whitespace\BlankLineBetweenImportGroupsFixer::class,
2743
])
2844

29-
// PER Coding Style 7.1: "The `fn` keyword MUST NOT be succeeded by a space."
45+
// Rule from PSR12. PER Coding Style 7.1: "The `fn` keyword MUST NOT be succeeded by a space."
3046
->withConfiguredRule(
3147
\PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer::class,
3248
[
3349
'closure_fn_spacing' => 'none',
34-
]
50+
],
3551
);

src/Config.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Phlib\Logger;
66

77
/**
8-
* Class Config
98
* @package Phlib\Logger
109
*/
1110
class Config implements ConfigInterface

src/ConfigInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Phlib\Logger;
66

77
/**
8-
* Interface ConfigInterface
98
* @package Phlib\Logger
109
*/
1110
interface ConfigInterface

src/Decorator/AbstractDecorator.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ abstract class AbstractDecorator extends AbstractLogger
1818
private $logger;
1919

2020
/**
21-
* AbstractDecorator constructor
22-
*
2321
* Stores the Logger for re-use in the concrete via getInnerLogger()
2422
*
2523
* If the concrete requires use of the config value, override the constructor

src/Decorator/LevelFilter.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Psr\Log\LogLevel;
1010

1111
/**
12-
* Class LevelFilter
1312
* @package Phlib\Logger
1413
*/
1514
class LevelFilter extends AbstractDecorator

src/Factory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Psr\Log\LoggerInterface;
88

99
/**
10-
* Class Factory
1110
* @package Phlib\Logger
1211
*/
1312
class Factory

src/LoggerType/CliColor.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
99

1010
/**
11-
* Class CliColor
12-
*
1311
* Write to CLI with colour!
1412
*
1513
* @package Phlib\Logger

src/LoggerType/Collection.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Psr\Log\LoggerInterface;
99

1010
/**
11-
* Class Collection
1211
* @package Phlib\Logger
1312
*/
1413
class Collection extends AbstractLogger

src/LoggerType/Stream.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Psr\Log\AbstractLogger;
88

99
/**
10-
* Class Stream
1110
* @package Phlib\Logger
1211
*/
1312
class Stream extends AbstractLogger

0 commit comments

Comments
 (0)