Skip to content

Commit

Permalink
bug #3912 FullyQualifiedStrictTypesFixer - NoSuperfluousPhpdocTagsFix…
Browse files Browse the repository at this point in the history
…er - adjust priority (dmvdbrugge)

This PR was merged into the 2.12 branch.

Discussion
----------

FullyQualifiedStrictTypesFixer - NoSuperfluousPhpdocTagsFixer - adjust priority

This fixes #3850

Commits
-------

fa17194 FullyQualifiedStrictTypesFixer - NoSuperfluousPhpdocTagsFixer - Priority
  • Loading branch information
keradus committed Aug 10, 2018
2 parents 499211a + fa17194 commit 76238aa
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 76238aa

Please sign in to comment.