Skip to content

Commit

Permalink
FullyQualifiedStrictTypesFixer - NoSuperfluousPhpdocTagsFixer - Priority
Browse files Browse the repository at this point in the history
  • Loading branch information
dmvdbrugge committed Jul 13, 2018
1 parent 0790602 commit b69bc6c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Fixer/Import/FullyQualifiedStrictTypesFixer.php
Expand Up @@ -70,6 +70,16 @@ public function doSomething(\Foo\Bar $foo): \Foo\Bar\Baz
);
}

/**
* {@inheritdoc}
*/
public function getPriority()
{
// should run after PhpdocToReturnTypeFixer
// should run before NoSuperfluousPhpdocTagsFixer
return 7;
}

/**
* {@inheritdoc}
*/
Expand Down
1 change: 1 addition & 0 deletions tests/AutoReview/FixerFactoryTest.php
Expand Up @@ -83,6 +83,7 @@ public function provideFixersPriorityCases()
[$fixers['elseif'], $fixers['braces']],
[$fixers['escape_implicit_backslashes'], $fixers['heredoc_to_nowdoc']],
[$fixers['escape_implicit_backslashes'], $fixers['single_quote']],
[$fixers['fully_qualified_strict_types'], $fixers['no_superfluous_phpdoc_tags']],
[$fixers['function_to_constant'], $fixers['native_function_casing']],
[$fixers['function_to_constant'], $fixers['no_extra_blank_lines']],
[$fixers['function_to_constant'], $fixers['no_singleline_whitespace_before_semicolons']],
Expand Down
@@ -0,0 +1,20 @@
--TEST--
Integration of fixers: fully_qualified_strict_types,no_superfluous_phpdoc_tags.
--RULESET--
{"fully_qualified_strict_types": true, "no_superfluous_phpdoc_tags": true}
--EXPECT--
<?php
// No namespace
/**
* @param bool $expected
*/
function testSomething(Foo $foo, $expected) {}

--INPUT--
<?php
// No namespace
/**
* @param Foo $foo
* @param bool $expected
*/
function testSomething(\Foo $foo, $expected) {}

0 comments on commit b69bc6c

Please sign in to comment.