-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
02eaae6
commit 99c1313
Showing
7 changed files
with
324 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
<?php | ||
|
||
namespace test\PhpStaticAnalysis\RectorRule\Fixture; | ||
|
||
use PhpStaticAnalysis\Attributes\ParamOut; | ||
use PhpStaticAnalysis\Attributes\Returns; | ||
|
||
class ParamOutAttributeTest | ||
{ | ||
/** | ||
* @param-out string $name | ||
*/ | ||
public function setName(&$name) | ||
{ | ||
$name = ''; | ||
} | ||
|
||
/** | ||
* @codeCoverageIgnore | ||
* @param-out string $name | ||
*/ | ||
public function setMoreNames(&$name) | ||
{ | ||
$name = ''; | ||
} | ||
|
||
/** | ||
* @param-out string $name | ||
*/ | ||
#[Returns('void')] | ||
public function setAnotherName(&$name) | ||
{ | ||
$name = ''; | ||
} | ||
|
||
/** | ||
* @param-out string $name1 | ||
* @param-out string $name2 | ||
*/ | ||
public function setTwoNames(&$name1, &$name2) | ||
{ | ||
$name1 = ''; | ||
$name2 = ''; | ||
} | ||
|
||
/** | ||
* @param-out string $name2 | ||
*/ | ||
#[ParamOut(name1: 'string')] | ||
public function setTwoMoreNames(&$name1, &$name2) | ||
{ | ||
$name1 = ''; | ||
$name2 = ''; | ||
} | ||
|
||
/** | ||
* @param-out string $name the name of the user | ||
*/ | ||
public function setUserName(&$name) | ||
{ | ||
$name = ''; | ||
} | ||
|
||
/** | ||
* @psalm-param-out string $name | ||
*/ | ||
public function setPsalmName(&$name) | ||
{ | ||
$name = ''; | ||
} | ||
|
||
/** | ||
* @phpstan-param-out string $name | ||
*/ | ||
public function setPHPStanName(&$name) | ||
{ | ||
$name = ''; | ||
} | ||
} | ||
|
||
/** | ||
* @param-out string $name | ||
*/ | ||
function setName(&$name) | ||
{ | ||
$name = ''; | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace test\PhpStaticAnalysis\RectorRule\Fixture; | ||
|
||
use PhpStaticAnalysis\Attributes\ParamOut; | ||
use PhpStaticAnalysis\Attributes\Returns; | ||
|
||
class ParamOutAttributeTest | ||
{ | ||
#[\PhpStaticAnalysis\Attributes\ParamOut(name: 'string')] | ||
public function setName(&$name) | ||
{ | ||
$name = ''; | ||
} | ||
|
||
/** | ||
* @codeCoverageIgnore | ||
*/ | ||
#[\PhpStaticAnalysis\Attributes\ParamOut(name: 'string')] | ||
public function setMoreNames(&$name) | ||
{ | ||
$name = ''; | ||
} | ||
|
||
#[Returns('void')] | ||
#[\PhpStaticAnalysis\Attributes\ParamOut(name: 'string')] | ||
public function setAnotherName(&$name) | ||
{ | ||
$name = ''; | ||
} | ||
|
||
#[\PhpStaticAnalysis\Attributes\ParamOut(name1: 'string')] | ||
#[\PhpStaticAnalysis\Attributes\ParamOut(name2: 'string')] | ||
public function setTwoNames(&$name1, &$name2) | ||
{ | ||
$name1 = ''; | ||
$name2 = ''; | ||
} | ||
|
||
#[ParamOut(name1: 'string')] | ||
#[\PhpStaticAnalysis\Attributes\ParamOut(name2: 'string')] | ||
public function setTwoMoreNames(&$name1, &$name2) | ||
{ | ||
$name1 = ''; | ||
$name2 = ''; | ||
} | ||
|
||
#[\PhpStaticAnalysis\Attributes\ParamOut(name: 'string')] // the name of the user | ||
public function setUserName(&$name) | ||
{ | ||
$name = ''; | ||
} | ||
|
||
#[\PhpStaticAnalysis\Attributes\ParamOut(name: 'string')] | ||
public function setPsalmName(&$name) | ||
{ | ||
$name = ''; | ||
} | ||
|
||
#[\PhpStaticAnalysis\Attributes\ParamOut(name: 'string')] | ||
public function setPHPStanName(&$name) | ||
{ | ||
$name = ''; | ||
} | ||
} | ||
|
||
#[\PhpStaticAnalysis\Attributes\ParamOut(name: 'string')] | ||
function setName(&$name) | ||
{ | ||
$name = ''; | ||
} | ||
|
||
?> |
Oops, something went wrong.