1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00
This commit is contained in:
Daniil Gentili 2022-10-10 11:46:47 +02:00
parent fe17720441
commit 2e8fd6fc1d

View File

@ -357,12 +357,12 @@ abstract class Type
/** /**
* @psalm-pure * @psalm-pure
*/ */
public static function getFloat(?float $value = null): Union public static function getFloat(?float $value = null, bool $from_docblock = false): Union
{ {
if ($value !== null) { if ($value !== null) {
$type = new TLiteralFloat($value); $type = new TLiteralFloat($value, $from_docblock);
} else { } else {
$type = new TFloat(); $type = new TFloat($from_docblock);
} }
return new Union([$type]); return new Union([$type]);