Skip to content

Commit d0c86af

Browse files
authored
Fix psalm errors (#115)
* Fix psalm errors * fix * fix
1 parent 7fd4b53 commit d0c86af

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"rector/rector": "^1.0",
5555
"roave/infection-static-analysis-plugin": "^1.16",
5656
"spatie/phpunit-watcher": "^1.23",
57-
"vimeo/psalm": "^4.30|^5.20",
57+
"vimeo/psalm": "^4.30|^5.25",
5858
"yiisoft/di": "^1.1",
5959
"yiisoft/test-support": "^1.3"
6060
},

src/Exception/ErrorException.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414

1515
/**
1616
* `ErrorException` represents a PHP error.
17-
*
1817
* @psalm-type DebugBacktraceType = list<array{args?:list<mixed>,class?:class-string,file?:string,function:string,line?:int,object?:object,type?:string}>
1918
*/
2019
class ErrorException extends \ErrorException implements FriendlyExceptionInterface
2120
{
21+
/**
22+
* @psalm-suppress MissingClassConstType Private constants never change.
23+
*/
2224
private const ERROR_NAMES = [
2325
E_ERROR => 'PHP Fatal Error',
2426
E_WARNING => 'PHP Warning',
@@ -37,9 +39,7 @@ class ErrorException extends \ErrorException implements FriendlyExceptionInterfa
3739
E_USER_DEPRECATED => 'PHP User Deprecated Warning',
3840
];
3941

40-
/**
41-
* @psalm-param DebugBacktraceType $backtrace
42-
*/
42+
/** @psalm-param DebugBacktraceType $backtrace */
4343
public function __construct(string $message = '', int $code = 0, int $severity = 1, string $filename = __FILE__, int $line = __LINE__, Exception $previous = null, private array $backtrace = [])
4444
{
4545
parent::__construct($message, $code, $severity, $filename, $line, $previous);

src/ThrowableRendererInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
*/
1313
interface ThrowableRendererInterface
1414
{
15+
/**
16+
* @psalm-suppress MissingClassConstType After raise PHP version this constant will be final.
17+
*/
1518
public const DEFAULT_ERROR_MESSAGE = 'An internal server error occurred.';
1619

1720
/**

0 commit comments

Comments
 (0)