-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: php8 support * feat: GHA ? * feat: removing composer.lock * feat: removing composer.lock * feat: type-hints in every files o/ * feat: self-review * feat: self review still * feat: fixing a dumb error :) * feat: fixing another error * feat: review * feat: review * feat: review * feat: constructor property promotion * feat: type hint ! * feat(quality): added PHPStan and rector * feat(quality): apply rector rules * feat(quality): fix phpstan warnings * feat(quality): removed useless constructor * feat(quality): updated ignore list * feat(quality): updated types and misc phpstan adjustments * feat(quality): apply rector & php-cs-fixer * feat(quality): simplify some code after adding better types * feat: merged vclavreul PR Co-authored-by: vderudet <[email protected]> Co-authored-by: Valentin Clavreul <[email protected]>
- Loading branch information
1 parent
b6e03f8
commit 194de71
Showing
63 changed files
with
705 additions
and
2,284 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
bin/ | ||
vendor/ | ||
src/M6Web/Bundle/LogBridgeBundle/Tests/Resources/cache/* | ||
composer.lock | ||
src/M6Web/Bundle/LogBridgeBundle/Tests/Fixtures/Resources/cache/* | ||
.php_cs.cache | ||
.php-cs-fixer.cache | ||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,12 @@ | ||
<?php | ||
|
||
$config = new class() extends \PhpCsFixer\Config { | ||
public function __construct() | ||
{ | ||
parent::__construct('Bedrock(PHP 7.1)'); | ||
} | ||
|
||
public function getRules() | ||
{ | ||
return (new \M6Web\CS\Config\Php71())->getRules() + ['increment_style' => false]; | ||
} | ||
}; | ||
|
||
$config->getFinder() | ||
->in([ | ||
__DIR__.'/src' | ||
])->exclude([ | ||
'Tests' | ||
]); | ||
|
||
return $config; | ||
return (new \M6Web\CS\Config\BedrockStreaming()) | ||
->setFinder( | ||
PhpCsFixer\Finder::create() | ||
->in([ | ||
__DIR__.'/src' | ||
]) | ||
->exclude([ | ||
'Tests' | ||
]) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
parameters: | ||
level: max | ||
paths: | ||
- src | ||
excludePaths: | ||
# This class is deprecated, we don't care about warnings | ||
- src/M6Web/Bundle/LogBridgeBundle/EventDispatcher/BuilderEvent.php | ||
- src/M6Web/Bundle/LogBridgeBundle/Tests/* | ||
|
||
# Errors from DependencyInjection : hard to fix, not that useful | ||
ignoreErrors: | ||
- | ||
message: "#^Parameter \\#1 \\$id of method Symfony\\\\Component\\\\DependencyInjection\\\\ContainerBuilder\\:\\:findDefinition\\(\\) expects string, array\\|bool\\|float\\|int\\|string\\|UnitEnum\\|null given\\.$#" | ||
count: 1 | ||
path: src/M6Web/Bundle/LogBridgeBundle/DependencyInjection/CompilerPass/LoggerValidationPass.php | ||
|
||
- | ||
message: "#^Parameter \\#1 \\$object_or_class of function class_implements expects object\\|string, array\\|bool\\|float\\|int\\|string\\|UnitEnum\\|null given\\.$#" | ||
count: 1 | ||
path: src/M6Web/Bundle/LogBridgeBundle/DependencyInjection/CompilerPass/LoggerValidationPass.php | ||
|
||
- | ||
message: "#^Parameter \\#1 \\$string of function substr expects string, string\\|null given\\.$#" | ||
count: 1 | ||
path: src/M6Web/Bundle/LogBridgeBundle/DependencyInjection/CompilerPass/LoggerValidationPass.php | ||
|
||
- | ||
message: "#^Parameter \\#2 \\$haystack of function in_array expects array, array\\<string, string\\>\\|false given\\.$#" | ||
count: 1 | ||
path: src/M6Web/Bundle/LogBridgeBundle/DependencyInjection/CompilerPass/LoggerValidationPass.php | ||
|
||
- | ||
message: "#^Parameter \\#2 \\$subject of function preg_match expects string, string\\|null given\\.$#" | ||
count: 1 | ||
path: src/M6Web/Bundle/LogBridgeBundle/DependencyInjection/CompilerPass/LoggerValidationPass.php | ||
|
||
- | ||
message: "#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, array\\|bool\\|float\\|int\\|string\\|UnitEnum\\|null given\\.$#" | ||
count: 1 | ||
path: src/M6Web/Bundle/LogBridgeBundle/DependencyInjection/CompilerPass/LoggerValidationPass.php | ||
|
||
- | ||
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" | ||
count: 1 | ||
path: src/M6Web/Bundle/LogBridgeBundle/DependencyInjection/Configuration.php | ||
|
||
- | ||
message: "#^Method M6Web\\\\Bundle\\\\LogBridgeBundle\\\\DependencyInjection\\\\M6WebLogBridgeExtension\\:\\:load\\(\\) has parameter \\$configs with no value type specified in iterable type array\\.$#" | ||
count: 1 | ||
path: src/M6Web/Bundle/LogBridgeBundle/DependencyInjection/M6WebLogBridgeExtension.php | ||
|
||
- | ||
message: "#^Parameter \\#1 \\$class of class Symfony\\\\Component\\\\DependencyInjection\\\\Definition constructor expects string\\|null, array\\|bool\\|float\\|int\\|string\\|UnitEnum\\|null given\\.$#" | ||
count: 2 | ||
path: src/M6Web/Bundle/LogBridgeBundle/DependencyInjection/M6WebLogBridgeExtension.php | ||
|
||
- | ||
message: "#^Parameter \\#1 \\$id of class Symfony\\\\Component\\\\DependencyInjection\\\\Reference constructor expects string, array\\|bool\\|float\\|int\\|string\\|UnitEnum\\|null given\\.$#" | ||
count: 3 | ||
path: src/M6Web/Bundle/LogBridgeBundle/DependencyInjection/M6WebLogBridgeExtension.php | ||
|
||
- | ||
message: "#^Parameter \\#1 \\$id of method Symfony\\\\Component\\\\DependencyInjection\\\\ContainerBuilder\\:\\:setDefinition\\(\\) expects string, array\\|bool\\|float\\|int\\|string\\|UnitEnum\\|null given\\.$#" | ||
count: 2 | ||
path: src/M6Web/Bundle/LogBridgeBundle/DependencyInjection/M6WebLogBridgeExtension.php | ||
|
||
- | ||
message: "#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge expects array, array\\|bool\\|float\\|int\\|string\\|UnitEnum\\|null given\\.$#" | ||
count: 1 | ||
path: src/M6Web/Bundle/LogBridgeBundle/DependencyInjection/M6WebLogBridgeExtension.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; | ||
use Rector\Config\RectorConfig; | ||
use Rector\Set\ValueObject\LevelSetList; | ||
|
||
return static function (RectorConfig $rectorConfig): void { | ||
$rectorConfig->paths([ | ||
__DIR__ . '/src' | ||
]); | ||
|
||
// register a single rule | ||
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class); | ||
|
||
// define sets of rules | ||
$rectorConfig->sets([ | ||
LevelSetList::UP_TO_PHP_80 | ||
]); | ||
}; |
46 changes: 11 additions & 35 deletions
46
src/M6Web/Bundle/LogBridgeBundle/Config/Configuration.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.