Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FullyQualifiedStrictTypesFixer - NoSuperfluousPhpdocTagsFixer - adjust priority #3912

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the added test shows the prio issue for NoSuperfluousPhpdocTagsFixer, but not for PhpdocToReturnTypeFixer, is the priority test missing or is the comment a bit off?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The priority test already exists because the priority was already there (and adhered to).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah check, missed that one 👍

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) {}