File tree Expand file tree Collapse file tree 2 files changed +28
-28
lines changed
src/Standards/Squiz/Tests/WhiteSpace Expand file tree Collapse file tree 2 files changed +28
-28
lines changed Original file line number Diff line number Diff line change @@ -81,23 +81,23 @@ class MyOtherClass
8181 $ varS ,
8282 $ varT ,
8383 $ varU ;
84- }
8584
86- // Issue #3188 - static as return type.
87- public static function fCreate ($ attributes = []): static
88- {
89- return static ::factory ()->create ($ attributes );
90- }
85+ // Issue #3188 - static as return type.
86+ public static function staticAsReturnType ($ attributes = []): static
87+ {
88+ return static ::factory ()->create ($ attributes );
89+ }
9190
92- public static function fCreate ($ attributes = []): ?static
93- {
94- return static ::factory ()->create ($ attributes );
95- }
91+ public static function nullableStaticReturnType ($ attributes = []): ?static
92+ {
93+ return static ::factory ()->create ($ attributes );
94+ }
9695
97- // Also account for static used within union types.
98- public function staticLast ($ attributes = []): object |static {}
99- public function staticMiddle (): string |static |object {}
100- public function staticFirst (): static |object {}
96+ // Also account for static used within union types.
97+ public function staticLast ($ attributes = []): object |static {}
98+ public function staticMiddle (): string |static |object {}
99+ public function staticFirst (): static |object {}
100+ }
101101
102102// Ensure that static as a scope keyword when preceeded by a colon which is not for a type declaration is still handled.
103103$ callback = $ cond ? get_fn_name () : static function ($ a ) { return $ a * 10 ; };
Original file line number Diff line number Diff line change @@ -76,23 +76,23 @@ class MyOtherClass
7676 $varS,
7777 $varT,
7878 $varU;
79- }
8079
81- // Issue #3188 - static as return type.
82- public static function fCreate ($attributes = []): static
83- {
84- return static::factory()->create($attributes);
85- }
80+ // Issue #3188 - static as return type.
81+ public static function staticAsReturnType ($attributes = []): static
82+ {
83+ return static::factory()->create($attributes);
84+ }
8685
87- public static function fCreate ($attributes = []): ?static
88- {
89- return static::factory()->create($attributes);
90- }
86+ public static function nullableStaticReturnType ($attributes = []): ?static
87+ {
88+ return static::factory()->create($attributes);
89+ }
9190
92- // Also account for static used within union types.
93- public function staticLast($attributes = []): object|static {}
94- public function staticMiddle(): string|static|object {}
95- public function staticFirst(): static|object {}
91+ // Also account for static used within union types.
92+ public function staticLast($attributes = []): object|static {}
93+ public function staticMiddle(): string|static|object {}
94+ public function staticFirst(): static|object {}
95+ }
9696
9797// Ensure that static as a scope keyword when preceeded by a colon which is not for a type declaration is still handled.
9898$callback = $cond ? get_fn_name() : static function ($a) { return $a * 10; };
You can’t perform that action at this time.
0 commit comments