From 7679d956ddcbd5c90f9cf1a89504385bed7dce06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Wed, 28 Sep 2022 20:38:28 +0200 Subject: [PATCH 1/2] [CS] Indent heredoc blocks --- .php-cs-fixer.php | 2 ++ tests/ParallelizationIntegrationTest.php | 40 ++++++++++++------------ 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 68ed4bb..401afee 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -53,6 +53,8 @@ EOF, 'location' => 'after_open', ], + 'heredoc_indentation' => true, + 'heredoc_to_nowdoc' => true, 'is_null' => true, 'list_syntax' => [ 'syntax' => 'short', diff --git a/tests/ParallelizationIntegrationTest.php b/tests/ParallelizationIntegrationTest.php index fc296f1..a0527e1 100644 --- a/tests/ParallelizationIntegrationTest.php +++ b/tests/ParallelizationIntegrationTest.php @@ -68,14 +68,14 @@ public function test_it_can_run_the_command_without_sub_processes(): void self::assertSame( <<<'EOF' -Processing 2 movies in segments of 2, batches of 50, 1 round, 1 batch in 1 process + Processing 2 movies in segments of 2, batches of 50, 1 round, 1 batch in 1 process - 0/2 [>---------------------------] 0% < 1 sec/< 1 sec 10.0 MiB - 2/2 [============================] 100% < 1 sec/< 1 sec 10.0 MiB + 0/2 [>---------------------------] 0% < 1 sec/< 1 sec 10.0 MiB + 2/2 [============================] 100% < 1 sec/< 1 sec 10.0 MiB -Processed 2 movies. + Processed 2 movies. -EOF + EOF , $actual, 'Expected logs to be identical' @@ -96,14 +96,14 @@ public function test_it_can_run_the_command_with_a_single_sub_processes(): void self::assertSame( <<<'EOF' -Processing 2 movies in segments of 50, batches of 50, 1 round, 1 batch in 1 process + Processing 2 movies in segments of 50, batches of 50, 1 round, 1 batch in 1 process - 0/2 [>---------------------------] 0% < 1 sec/< 1 sec 10.0 MiB - 2/2 [============================] 100% < 1 sec/< 1 sec 10.0 MiB + 0/2 [>---------------------------] 0% < 1 sec/< 1 sec 10.0 MiB + 2/2 [============================] 100% < 1 sec/< 1 sec 10.0 MiB -Processed 2 movies. + Processed 2 movies. -EOF + EOF , $actual, 'Expected logs to be identical' @@ -124,14 +124,14 @@ public function test_it_can_run_the_command_with_multiple_processes(): void self::assertSame( <<<'EOF' -Processing 2 movies in segments of 50, batches of 50, 1 round, 1 batch in 2 processes + Processing 2 movies in segments of 50, batches of 50, 1 round, 1 batch in 2 processes - 0/2 [>---------------------------] 0% < 1 sec/< 1 sec 10.0 MiB - 2/2 [============================] 100% < 1 sec/< 1 sec 10.0 MiB + 0/2 [>---------------------------] 0% < 1 sec/< 1 sec 10.0 MiB + 2/2 [============================] 100% < 1 sec/< 1 sec 10.0 MiB -Processed 2 movies. + Processed 2 movies. -EOF + EOF , $actual, 'Expected logs to be identical' @@ -152,14 +152,14 @@ public function test_it_can_run_the_command_with_one_process_as_child_process(): self::assertSame( <<<'EOF' -Processing 2 movies in segments of 50, batches of 50, 1 round, 1 batch in 1 process + Processing 2 movies in segments of 50, batches of 50, 1 round, 1 batch in 1 process -0/2 [>---------------------------] 0% < 1 sec/< 1 sec 10.0 MiB -2/2 [============================] 100% < 1 sec/< 1 sec 10.0 MiB + 0/2 [>---------------------------] 0% < 1 sec/< 1 sec 10.0 MiB + 2/2 [============================] 100% < 1 sec/< 1 sec 10.0 MiB -Processed 2 movies. + Processed 2 movies. -EOF + EOF , $actual, 'Expected logs to be identical' From 43eff512bc75e85fac8773668fc5a75fda6e8c74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Wed, 28 Sep 2022 20:42:39 +0200 Subject: [PATCH 2/2] Fix CS --- tests/ParallelizationIntegrationTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ParallelizationIntegrationTest.php b/tests/ParallelizationIntegrationTest.php index b19ffea..146bdf1 100644 --- a/tests/ParallelizationIntegrationTest.php +++ b/tests/ParallelizationIntegrationTest.php @@ -154,8 +154,8 @@ public function test_it_can_run_the_command_with_one_process_as_child_process(): <<<'EOF' Processing 2 movies in segments of 50, batches of 50, 1 round, 1 batch in 1 process - 0/2 [>---------------------------] 0% < 1 sec/< 1 sec 10.0 MiB - 2/2 [============================] 100% < 1 sec/< 1 sec 10.0 MiB + 0/2 [>---------------------------] 0% < 1 sec/< 1 sec 10.0 MiB + 2/2 [============================] 100% < 1 sec/< 1 sec 10.0 MiB Processed 2 movies.