1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

fix #7747: DateInterval::createFromDateString can be false

This commit is contained in:
Ne-Lexa 2022-03-05 22:37:55 +03:00
parent d24b32bb05
commit a57bb1f128
2 changed files with 6 additions and 1 deletions

View File

@ -1762,7 +1762,7 @@ return [
'DateInterval::__construct' => ['void', 'spec'=>'string'],
'DateInterval::__set_state' => ['DateInterval', 'array'=>'array'],
'DateInterval::__wakeup' => ['void'],
'DateInterval::createFromDateString' => ['DateInterval', 'time'=>'string'],
'DateInterval::createFromDateString' => ['DateInterval|false', 'time'=>'string'],
'DateInterval::format' => ['string', 'format'=>'string'],
'DatePeriod::__construct' => ['void', 'start'=>'DateTimeInterface', 'interval'=>'DateInterval', 'recur'=>'int', 'options='=>'int'],
'DatePeriod::__construct\'1' => ['void', 'start'=>'DateTimeInterface', 'interval'=>'DateInterval', 'end'=>'DateTimeInterface', 'options='=>'int'],

View File

@ -904,6 +904,11 @@ class ValueTest extends TestCase
if (empty($s)) {}
}',
],
'falseDateInterval' => [
'<?php
$interval = \DateInterval::createFromDateString("30 дней");
if ($interval === false) {}',
],
];
}