-
-
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
8032ba7
commit c35515d
Showing
5 changed files
with
142 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<?php | ||
|
||
namespace test\PhpStaticAnalysis\RectorRule\Fixture; | ||
|
||
use Exception; | ||
use PhpStaticAnalysis\Attributes\Param; | ||
|
||
class ThrowsAttributeTest | ||
{ | ||
/** | ||
* @throws Exception | ||
*/ | ||
public function getName(): void | ||
{ | ||
throw new Exception(); | ||
} | ||
|
||
/** | ||
* @codeCoverageIgnore | ||
* @throws Exception | ||
*/ | ||
public function getMoreNames(): void | ||
{ | ||
throw new Exception(); | ||
} | ||
|
||
/** | ||
* @throws Exception | ||
*/ | ||
#[Param(name:'string')] | ||
public function getAnotherName($name): void | ||
{ | ||
throw new Exception(); | ||
} | ||
|
||
/** | ||
* @throws Exception this is the exception that is thrown | ||
*/ | ||
public function getUserName(): void | ||
{ | ||
throw new Exception(); | ||
} | ||
|
||
/** | ||
* @phpstan-throws Exception | ||
*/ | ||
public function getPHPStanName(): void | ||
{ | ||
throw new Exception(); | ||
} | ||
} | ||
|
||
/** | ||
* @throws Exception | ||
*/ | ||
function getName(): void | ||
{ | ||
throw new Exception(); | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace test\PhpStaticAnalysis\RectorRule\Fixture; | ||
|
||
use Exception; | ||
use PhpStaticAnalysis\Attributes\Param; | ||
|
||
class ThrowsAttributeTest | ||
{ | ||
#[\PhpStaticAnalysis\Attributes\Throws('Exception')] | ||
public function getName(): void | ||
{ | ||
throw new Exception(); | ||
} | ||
|
||
/** | ||
* @codeCoverageIgnore | ||
*/ | ||
#[\PhpStaticAnalysis\Attributes\Throws('Exception')] | ||
public function getMoreNames(): void | ||
{ | ||
throw new Exception(); | ||
} | ||
|
||
#[Param(name:'string')] | ||
#[\PhpStaticAnalysis\Attributes\Throws('Exception')] | ||
public function getAnotherName($name): void | ||
{ | ||
throw new Exception(); | ||
} | ||
|
||
#[\PhpStaticAnalysis\Attributes\Throws('Exception')] // this is the exception that is thrown | ||
public function getUserName(): void | ||
{ | ||
throw new Exception(); | ||
} | ||
|
||
#[\PhpStaticAnalysis\Attributes\Throws('Exception')] | ||
public function getPHPStanName(): void | ||
{ | ||
throw new Exception(); | ||
} | ||
} | ||
|
||
#[\PhpStaticAnalysis\Attributes\Throws('Exception')] | ||
function getName(): void | ||
{ | ||
throw new Exception(); | ||
} | ||
|
||
?> |