forked from vimeo/psalm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TLiteralFloat.php
44 lines (37 loc) · 909 Bytes
/
TLiteralFloat.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace Psalm\Type\Atomic;
/**
* Denotes a floating point value where the exact numeric value is known.
*/
final class TLiteralFloat extends TFloat
{
/** @var float */
public $value;
public function __construct(float $value)
{
$this->value = $value;
}
public function getKey(bool $include_extra = true): string
{
return 'float(' . $this->value . ')';
}
public function getId(bool $exact = true, bool $nested = false): string
{
if (!$exact) {
return 'float';
}
return 'float(' . $this->value . ')';
}
/**
* @param array<lowercase-string, string> $aliased_classes
*
*/
public function toNamespacedString(
?string $namespace,
array $aliased_classes,
?string $this_class,
bool $use_phpdoc_format
): string {
return 'float';
}
}