| 1: | <?php declare(strict_types = 1); |
| 2: | |
| 3: | namespace PHPStan\Type; |
| 4: | |
| 5: | /** |
| 6: | * A type whose value is known at analysis time — a compile-time constant scalar. |
| 7: | * |
| 8: | * Implemented by ConstantIntegerType, ConstantFloatType, ConstantStringType, |
| 9: | * ConstantBooleanType, and NullType. |
| 10: | * |
| 11: | * Use Type::isConstantValue() to check if a type is constant without instanceof, |
| 12: | * and Type::getConstantScalarTypes() to extract constant types from unions. |
| 13: | * |
| 14: | * @api |
| 15: | */ |
| 16: | interface ConstantScalarType extends Type |
| 17: | { |
| 18: | |
| 19: | /** @return int|float|string|bool|null */ |
| 20: | public function getValue(); |
| 21: | |
| 22: | } |
| 23: |