Skip to content

Commit

Permalink
NoSuperfluousPhpdocTagsFixer - add tests for reference and splat oper…
Browse files Browse the repository at this point in the history
…ator
  • Loading branch information
kubawerlos committed Jan 14, 2022
1 parent 333f15e commit 85b0429
Showing 1 changed file with 98 additions and 0 deletions.
98 changes: 98 additions & 0 deletions tests/Fixer/Phpdoc/NoSuperfluousPhpdocTagsFixerTest.php
Expand Up @@ -1496,6 +1496,104 @@ final class Bar{}
*/
class Foo {
}', ],
'remove when used with reference' => [
'<?php class Foo {
/**
*/
function f1(string &$x) {}
/**
*/
function f2(string &$x) {}
/**
*/
function f3(string &$x) {}
}',
'<?php class Foo {
/**
* @param string $x
*/
function f1(string &$x) {}
/**
* @param string &$x
*/
function f2(string &$x) {}
/**
* @param string $y Description
*/
function f3(string &$x) {}
}',
],
'dont remove when used with reference' => [
'<?php class Foo {
/**
* @param string ...$x Description
*/
function f(string ...$x) {}
}',
],
'remove when used with splat operator' => [
'<?php class Foo {
/**
*/
function f1(string ...$x) {}
/**
*/
function f2(string ...$x) {}
}',
'<?php class Foo {
/**
* @param string ...$x
*/
function f1(string ...$x) {}
/**
* @param string ...$y Description
*/
function f2(string ...$x) {}
}',
],
'dont remove when used with splat operator' => [
'<?php class Foo {
/**
* @param string ...$x Description
*/
function f(string ...$x) {}
}',
],
'remove when used with reference and splat operator' => [
'<?php class Foo {
/**
*/
function f1(string &...$x) {}
/**
*/
function f2(string &...$x) {}
/**
*/
function f3(string &...$x) {}
}',
'<?php class Foo {
/**
* @param string ...$x
*/
function f1(string &...$x) {}
/**
* @param string &...$x
*/
function f2(string &...$x) {}
/**
* @param string ...$y Description
*/
function f3(string &...$x) {}
}',
],
'dont remove when used with reference and splat operator' => [
'<?php class Foo {
/**
* @param string &...$x Description
*/
function f(string &...$x) {}
}',
],
];
}

Expand Down

0 comments on commit 85b0429

Please sign in to comment.