-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct VerbosityLevel in TooWide*ReturnType rules
- Loading branch information
1 parent
8a538de
commit 838d1e4
Showing
6 changed files
with
51 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,37 @@ | ||
<?php | ||
|
||
namespace Bug5095; | ||
|
||
final class UnaryOperator | ||
{ | ||
const PLUS = '+'; | ||
const MINUS = '-'; | ||
const DIVIDE = '/'; | ||
const NOT = 'not'; | ||
} | ||
|
||
class Parser | ||
{ | ||
/** | ||
* Returns the unary operator corresponding to $character, or `null` if | ||
* the character is not a unary operator. | ||
* | ||
* @phpstan-return UnaryOperator::*|null | ||
*/ | ||
private function unaryOperatorFor(string $character): ?string | ||
{ | ||
switch ($character) { | ||
case '+': | ||
return UnaryOperator::PLUS; | ||
|
||
case '-': | ||
return UnaryOperator::MINUS; | ||
|
||
case '/': | ||
return UnaryOperator::DIVIDE; | ||
|
||
default: | ||
return null; | ||
} | ||
} | ||
} |