Php-cs-fixer: "fully_qualified_strict_types": support typed properties

Created on 12 Jun 2020  路  1Comment  路  Source: FriendsOfPHP/PHP-CS-Fixer

Current behavior

 use Foo\Bar;
 use Foo\Bar\Baz;

 class SomeClass
 {
     private \Foo\Bar\Baz $baz;

-    public function doSomething(\Foo\Bar $foo): \Foo\Bar\Baz
+    public function doSomething(Bar $foo): Baz
     {
     }
 }

Expected behavior

 use Foo\Bar;
 use Foo\Bar\Baz;

 class SomeClass
 {
-    private \Foo\Bar\Baz $baz;
+    private Baz $baz;

-    public function doSomething(\Foo\Bar $foo): \Foo\Bar\Baz
+    public function doSomething(Bar $foo): Baz
     {
     }
 }
kinfeature request

Most helpful comment

Note: I added the "feature request" label but IMO this should be considered an enhancement and target lowest maintained branch.

>All comments

Note: I added the "feature request" label but IMO this should be considered an enhancement and target lowest maintained branch.

Was this page helpful?
0 / 5 - 0 ratings