From 96cfd24d76a1237e6c29b9b7bfae0ad4e32e39f3 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sun, 10 Dec 2023 02:07:20 +0100 Subject: [PATCH] Squiz/ScopeKeywordSpacing: add extra tests with static in a union type This is already handled correctly, the tests just safeguards this. --- .../Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc | 6 +++--- .../WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc b/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc index 12685dc97d..a76f42fef4 100644 --- a/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc +++ b/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc @@ -95,9 +95,9 @@ public static function fCreate($attributes = []): ?static } // Also account for static used within union types. -public function fCreate($attributes = []): object|static -{ -} +public function staticLast($attributes = []): object|static {} +public function staticMiddle(): string|static|object {} +public function staticFirst(): static|object {} // Ensure that static as a scope keyword when preceeded by a colon which is not for a type declaration is still handled. $callback = $cond ? get_fn_name() : static function ($a) { return $a * 10; }; diff --git a/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed b/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed index d3b682ed75..7fd80626d5 100644 --- a/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed +++ b/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed @@ -90,9 +90,9 @@ public static function fCreate($attributes = []): ?static } // Also account for static used within union types. -public function fCreate($attributes = []): object|static -{ -} +public function staticLast($attributes = []): object|static {} +public function staticMiddle(): string|static|object {} +public function staticFirst(): static|object {} // Ensure that static as a scope keyword when preceeded by a colon which is not for a type declaration is still handled. $callback = $cond ? get_fn_name() : static function ($a) { return $a * 10; };