Fork me on GitHub
a Sensio Labs Product

Mountains (v3.2.1) edition

Rule fully_qualified_strict_types

Transforms imported FQCN parameters and return types in function arguments to short version.

Examples

Example #1

--- Original
+++ New
 <?php

 use Foo\Bar;

 class SomeClass
 {
-    public function doSomething(\Foo\Bar $foo)
+    public function doSomething(Bar $foo)
     {
     }
 }

Example #2

--- Original
+++ New
 <?php

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

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

Rule sets

The rule is part of the following rule sets:

@PhpCsFixer

Using the @PhpCsFixer rule set will enable the fully_qualified_strict_types rule.

@Symfony

Using the @Symfony rule set will enable the fully_qualified_strict_types rule.

The logo is © 2010-2014 Sensio Labs