From 2a09afec970757ce130645ca5af7b982c2f11ce2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= <5175937+theofidry@users.noreply.github.com> Date: Sun, 25 Sep 2022 14:07:26 +0200 Subject: [PATCH] Fix CS (#705) --- .php-cs-fixer.dist.php | 1 + src/Compactor/Php.php | 9 +++++---- src/FileSystem/FileSystem.php | 1 + src/Json/Json.php | 2 +- src/MapFile.php | 1 + src/functions.php | 4 ++-- tests/BoxTest.php | 1 + tests/Composer/ComposerOrchestratorTest.php | 6 +++--- tests/Configuration/ConfigurationFileNoConfigTest.php | 1 + tests/Configuration/ConfigurationFileTest.php | 1 + tests/Configuration/ConfigurationPhpCompactorTest.php | 1 + tests/Configuration/ConfigurationSigningTest.php | 1 + tests/Configuration/ConfigurationTest.php | 1 + tests/Console/Command/ValidateTest.php | 1 + tests/Json/JsonTest.php | 1 + tests/PhpUnitAnnotationsTest.php | 1 + 16 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index d4ff7deac..e15f18331 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -28,6 +28,7 @@ 'try', ], ], + 'blank_line_between_import_groups' => false, 'combine_consecutive_issets' => true, 'combine_consecutive_unsets' => true, 'compact_nullable_typehint' => true, diff --git a/src/Compactor/Php.php b/src/Compactor/Php.php index 88459f3a5..1c50c6385 100644 --- a/src/Compactor/Php.php +++ b/src/Compactor/Php.php @@ -43,6 +43,7 @@ * @author Théo Fidry * @author Juliette Reinders Folmer * @author Alessandro Chitolina + * * @private */ final class Php extends FileExtensionCompactor @@ -218,7 +219,7 @@ private function retokenizeAttribute(array &$tokens, int $opener): ?array // Multi-line attribute or attribute containing something which looks like a PHP close tag. // Retokenize the rest of the file after the attribute opener. if (null === $closer) { - foreach (array_slice($tokens, ($opener + 1)) as $token) { + foreach (array_slice($tokens, $opener + 1) as $token) { $attributeBody .= $token->text; } @@ -230,12 +231,12 @@ private function retokenizeAttribute(array &$tokens, int $opener): ?array if (null !== $closer) { array_splice( $tokens, - ($opener + 1), + $opener + 1, count($tokens), - array_slice($subTokens, ($closer + 1)), + array_slice($subTokens, $closer + 1), ); - $subTokens = array_slice($subTokens, 0, ($closer + 1)); + $subTokens = array_slice($subTokens, 0, $closer + 1); } } diff --git a/src/FileSystem/FileSystem.php b/src/FileSystem/FileSystem.php index f48b12ea3..138bc06a0 100644 --- a/src/FileSystem/FileSystem.php +++ b/src/FileSystem/FileSystem.php @@ -46,6 +46,7 @@ * @author Fabien Potencier * @author Bernhard Schussek * @author Thomas Schulz + * * @private */ final class FileSystem extends SymfonyFilesystem diff --git a/src/Json/Json.php b/src/Json/Json.php index da4dff023..6e41e026e 100644 --- a/src/Json/Json.php +++ b/src/Json/Json.php @@ -66,7 +66,7 @@ public function decode(string $json, bool $assoc = false): array|stdClass } return false === $assoc ? (object) $data : $data; // If JSON is an empty JSON json_decode returns an empty - // array instead of an stdClass instance + // array instead of an stdClass instance } /** diff --git a/src/MapFile.php b/src/MapFile.php index 9e45558f4..0ad3eeb11 100644 --- a/src/MapFile.php +++ b/src/MapFile.php @@ -20,6 +20,7 @@ /** * @internal + * * @private */ final class MapFile diff --git a/src/functions.php b/src/functions.php index 40158d05f..4d13a30d2 100644 --- a/src/functions.php +++ b/src/functions.php @@ -167,10 +167,10 @@ function memory_to_bytes(string $value): float|int switch ($unit) { case 'g': $bytes *= 1024; - // no break (cumulative multiplier) + // no break (cumulative multiplier) case 'm': $bytes *= 1024; - // no break (cumulative multiplier) + // no break (cumulative multiplier) case 'k': $bytes *= 1024; } diff --git a/tests/BoxTest.php b/tests/BoxTest.php index 0e6479991..58e9f43d4 100644 --- a/tests/BoxTest.php +++ b/tests/BoxTest.php @@ -1334,6 +1334,7 @@ public function test_it_cannot_compress_the_phar_while_buffering(): void /** * @dataProvider compressionAlgorithmsProvider + * * @requires extension zlib * @requires extension bz2 */ diff --git a/tests/Composer/ComposerOrchestratorTest.php b/tests/Composer/ComposerOrchestratorTest.php index 1f97067b7..5f690f3be 100644 --- a/tests/Composer/ComposerOrchestratorTest.php +++ b/tests/Composer/ComposerOrchestratorTest.php @@ -531,7 +531,7 @@ public static function composerAutoloadProvider(): iterable require_once __DIR__ . '/composer/autoload_real.php'; - \$loader = ${composerAutoloaderName}::getLoader(); + \$loader = {$composerAutoloaderName}::getLoader(); // Exposed functions. For more information see: // https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#exposing-functions @@ -571,7 +571,7 @@ function foo() { require_once __DIR__ . '/composer/autoload_real.php'; - \$loader = ${composerAutoloaderName}::getLoader(); + \$loader = {$composerAutoloaderName}::getLoader(); } @@ -627,7 +627,7 @@ function foo() { require_once __DIR__ . '/composer/autoload_real.php'; - \$loader = ${composerAutoloaderName}::getLoader(); + \$loader = {$composerAutoloaderName}::getLoader(); } diff --git a/tests/Configuration/ConfigurationFileNoConfigTest.php b/tests/Configuration/ConfigurationFileNoConfigTest.php index df94d3cd4..45c3cdece 100644 --- a/tests/Configuration/ConfigurationFileNoConfigTest.php +++ b/tests/Configuration/ConfigurationFileNoConfigTest.php @@ -25,6 +25,7 @@ /** * @covers \KevinGH\Box\Configuration\Configuration + * * @group config */ class ConfigurationFileNoConfigTest extends ConfigurationTestCase diff --git a/tests/Configuration/ConfigurationFileTest.php b/tests/Configuration/ConfigurationFileTest.php index c5290fbbe..a26025e5b 100644 --- a/tests/Configuration/ConfigurationFileTest.php +++ b/tests/Configuration/ConfigurationFileTest.php @@ -30,6 +30,7 @@ /** * @covers \KevinGH\Box\Configuration\Configuration + * * @group config */ class ConfigurationFileTest extends ConfigurationTestCase diff --git a/tests/Configuration/ConfigurationPhpCompactorTest.php b/tests/Configuration/ConfigurationPhpCompactorTest.php index a26de71f3..8550ab560 100644 --- a/tests/Configuration/ConfigurationPhpCompactorTest.php +++ b/tests/Configuration/ConfigurationPhpCompactorTest.php @@ -21,6 +21,7 @@ /** * @covers \KevinGH\Box\Configuration\Configuration + * * @group config */ class ConfigurationPhpCompactorTest extends ConfigurationTestCase diff --git a/tests/Configuration/ConfigurationSigningTest.php b/tests/Configuration/ConfigurationSigningTest.php index 4dc369aa0..3d9c9f18c 100644 --- a/tests/Configuration/ConfigurationSigningTest.php +++ b/tests/Configuration/ConfigurationSigningTest.php @@ -24,6 +24,7 @@ /** * @covers \KevinGH\Box\Configuration\Configuration * @covers \KevinGH\Box\MapFile + * * @group config */ class ConfigurationSigningTest extends ConfigurationTestCase diff --git a/tests/Configuration/ConfigurationTest.php b/tests/Configuration/ConfigurationTest.php index 3f6527c1b..d351de091 100644 --- a/tests/Configuration/ConfigurationTest.php +++ b/tests/Configuration/ConfigurationTest.php @@ -54,6 +54,7 @@ /** * @covers \KevinGH\Box\Configuration\Configuration * @covers \KevinGH\Box\MapFile + * * @group config */ class ConfigurationTest extends ConfigurationTestCase diff --git a/tests/Console/Command/ValidateTest.php b/tests/Console/Command/ValidateTest.php index a45fd5f46..003127f18 100644 --- a/tests/Console/Command/ValidateTest.php +++ b/tests/Console/Command/ValidateTest.php @@ -27,6 +27,7 @@ /** * @covers \KevinGH\Box\Console\Command\Validate * @covers \KevinGH\Box\Console\MessageRenderer + * * @runTestsInSeparateProcesses */ class ValidateTest extends CommandTestCase diff --git a/tests/Json/JsonTest.php b/tests/Json/JsonTest.php index d3886ceaf..f3be5a8e3 100644 --- a/tests/Json/JsonTest.php +++ b/tests/Json/JsonTest.php @@ -28,6 +28,7 @@ /** * @covers \KevinGH\Box\Json\Json + * * @requires extension mbstring */ class JsonTest extends FileSystemTestCase diff --git a/tests/PhpUnitAnnotationsTest.php b/tests/PhpUnitAnnotationsTest.php index ae16095e0..973d64530 100644 --- a/tests/PhpUnitAnnotationsTest.php +++ b/tests/PhpUnitAnnotationsTest.php @@ -24,6 +24,7 @@ /** * @runInSeparateProcess + * * @coversNothing */ class PhpUnitAnnotationsTest extends TestCase