mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 12:55:26 +01:00
Wip
This commit is contained in:
parent
f2138ace7b
commit
b376a8d4d7
@ -14,47 +14,38 @@ class ExceptionCodeTest extends TestCase
|
||||
yield 'RuntimeException' => [
|
||||
'<?php
|
||||
function f(\RuntimeException $e): int {
|
||||
$code = $e->getCode();
|
||||
return $code;
|
||||
return $e->getCode();
|
||||
}
|
||||
',
|
||||
['$code' => 'int'],
|
||||
[],
|
||||
];
|
||||
yield 'LogicException' => [
|
||||
'<?php
|
||||
function f(\LogicException $e): int {
|
||||
$code = $e->getCode();
|
||||
return $code;
|
||||
return $e->getCode();
|
||||
}
|
||||
',
|
||||
['$code' => 'int'],
|
||||
[],
|
||||
];
|
||||
yield 'PDOException' => [
|
||||
'<?php
|
||||
function f(\PDOException $e): string {
|
||||
$code = $e->getCode();
|
||||
return $code;
|
||||
return $e->getCode();
|
||||
}
|
||||
',
|
||||
['$code' => 'string'],
|
||||
[],
|
||||
];
|
||||
yield 'Exception' => [
|
||||
'<?php
|
||||
/** @return int|string */
|
||||
function f(\Exception $e) {
|
||||
/** @var \Throwable $e */
|
||||
$code = $e->getCode();
|
||||
return $code;
|
||||
}
|
||||
',
|
||||
['$code' => 'int|string'],
|
||||
];
|
||||
yield 'Throwable' => [
|
||||
'<?php
|
||||
/** @return int|string */
|
||||
function f(\Throwable $e) {
|
||||
/** @var \Exception $e */
|
||||
$code = $e->getCode();
|
||||
return $code;
|
||||
}
|
||||
',
|
||||
['$code' => 'int|string'],
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user