-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #876 from ergebnis/feature/identifier
Enhancement: Add rule error identifiers
- Loading branch information
Showing
54 changed files
with
376 additions
and
45 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
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,112 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Copyright (c) 2018-2024 Andreas Möller | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE.md file that was distributed with this source code. | ||
* | ||
* @see https://github.com/ergebnis/phpstan-rules | ||
*/ | ||
|
||
namespace Ergebnis\PHPStan\Rules; | ||
|
||
/** | ||
* @internale | ||
*/ | ||
final class ErrorIdentifier | ||
{ | ||
private function __construct(private readonly string $value) | ||
{ | ||
} | ||
|
||
public static function declareStrictTypes(): self | ||
{ | ||
return new self('declareStrictTypes'); | ||
} | ||
|
||
public static function final(): self | ||
{ | ||
return new self('final'); | ||
} | ||
|
||
public static function finalInAbstractClass(): self | ||
{ | ||
return new self('finalInAbstractClass'); | ||
} | ||
|
||
public static function noCompact(): self | ||
{ | ||
return new self('noCompact'); | ||
} | ||
|
||
public static function noConstructorParameterWithDefaultValue(): self | ||
{ | ||
return new self('noConstructorParameterWithDefaultValue'); | ||
} | ||
|
||
public static function noErrorSuppression(): self | ||
{ | ||
return new self('noErrorSuppression'); | ||
} | ||
|
||
public static function noEval(): self | ||
{ | ||
return new self('noEval'); | ||
} | ||
|
||
public static function noExtends(): self | ||
{ | ||
return new self('noExtends'); | ||
} | ||
|
||
public static function noIsset(): self | ||
{ | ||
return new self('noIsset'); | ||
} | ||
|
||
public static function noParameterWithContainerTypeDeclaration(): self | ||
{ | ||
return new self('noParameterWithContainerTypeDeclaration'); | ||
} | ||
|
||
public static function noParameterWithNullDefaultValue(): self | ||
{ | ||
return new self('noParameterWithNullDefaultValue'); | ||
} | ||
|
||
public static function noParameterWithNullableTypeDeclaration(): self | ||
{ | ||
return new self('noParameterWithNullableTypeDeclaration'); | ||
} | ||
|
||
public static function noNullableReturnTypeDeclaration(): self | ||
{ | ||
return new self('noNullableReturnTypeDeclaration'); | ||
} | ||
|
||
public static function noSwitch(): self | ||
{ | ||
return new self('noSwitch'); | ||
} | ||
|
||
public static function privateInFinalClass(): self | ||
{ | ||
return new self('privateInFinalClass'); | ||
} | ||
|
||
public static function testCaseWithSuffix(): self | ||
{ | ||
return new self('testCaseWithSuffix'); | ||
} | ||
|
||
public function toString(): string | ||
{ | ||
return \sprintf( | ||
'ergebnis.%s', | ||
$this->value, | ||
); | ||
} | ||
} |
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
Oops, something went wrong.