Skip to content

Commit

Permalink
PhpdocToParamTypeFixer - add failing cases
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus authored and julienfalque committed Nov 24, 2019
1 parent 9d996dd commit 4105c5f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/Fixer/FunctionNotation/PhpdocToParamTypeFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ class Foo {
'skip mixed types' => [
'<?php /** @param Foo|Bar $bar */ function my_foo($bar) {}',
],
'skip mixed types including array' => [
'<?php /** @param array|Foo $expected */ function testResolveIntersectionOfPaths($expected) {}',
],
'array of types' => [
'<?php /** @param Foo[] $foo */ function my_foo(array $foo) {}',
'<?php /** @param Foo[] $foo */ function my_foo($foo) {}',
Expand Down Expand Up @@ -316,6 +319,15 @@ class Foo {
'stop searching last token' => [
'<?php class Foo { /** @param Bar $bar */ public function foo($tab) { } }',
],
'param by reference' => [
'<?php /** @param array $data */ function sort(array &$data) {}',
'<?php /** @param array $data */ function sort(&$data) {}',
],
'optional param by reference' => [
'<?php /** @param null|string[] $matches */ function matchAll(?array &$matches) {}',
'<?php /** @param null|string[] $matches */ function matchAll(&$matches) {}',
70200,
],
];
}
}

0 comments on commit 4105c5f

Please sign in to comment.