From ab5cac3691e42801535ed41d02458e9842daeb61 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 30 Nov 2021 21:50:14 +0100 Subject: [PATCH] cs: Autofix code style. --- docs/pages/code/lazy-json-parsing.php | 9 +++------ grumphp.yml | 1 + spec/loophp/collection/CollectionSpec.php | 12 ++++++------ 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/docs/pages/code/lazy-json-parsing.php b/docs/pages/code/lazy-json-parsing.php index 694f4f42b..725d72fe0 100644 --- a/docs/pages/code/lazy-json-parsing.php +++ b/docs/pages/code/lazy-json-parsing.php @@ -31,8 +31,7 @@ $json = Collection::fromIterable(JsonMachine::fromFile($composerJson)); -foreach ($json as $key => $value) { -} +foreach ($json as $key => $value); $remoteFile = 'https://httpbin.org/anything'; @@ -43,8 +42,7 @@ $json = Collection::fromIterable(\JsonMachine\JsonMachine::fromStream($phpStream)); -foreach ($json as $key => $value) { -} +foreach ($json as $key => $value); // Parse a remote JSON file with Symfony HTTP client $client = HttpClient::create(); @@ -59,5 +57,4 @@ ) ); -foreach ($json as $key => $value) { -} +foreach ($json as $key => $value); diff --git a/grumphp.yml b/grumphp.yml index cd69ce6f2..37eebfa0f 100644 --- a/grumphp.yml +++ b/grumphp.yml @@ -8,6 +8,7 @@ parameters: # PHP CS Fixer tasks.phpcsfixer.config: .php-cs-fixer.dist.php + tasks.phpcsfixer.diff: true # PHPCS tasks.phpcs.ignore_patterns: diff --git a/spec/loophp/collection/CollectionSpec.php b/spec/loophp/collection/CollectionSpec.php index c4b9f3517..74d08aa20 100644 --- a/spec/loophp/collection/CollectionSpec.php +++ b/spec/loophp/collection/CollectionSpec.php @@ -2187,16 +2187,16 @@ public function it_can_isEmpty(): void $withValues = $this::fromIterable([1, 2, 3]); - foreach ($withValues as $value) { - // iterating once through it - } + foreach ($withValues as $value); + // iterating once through it + $withValues->isEmpty()->shouldBe(false); $withoutValues = $this::fromIterable([]); - foreach ($withoutValues as $value) { - // iterating once through it - } + foreach ($withoutValues as $value); + // iterating once through it + $withoutValues->isEmpty()->shouldBe(true); }