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: #[InstanceofDeprecated(insteadUse: 'Type::isConstantScalarValue() or Type::getConstantScalarTypes() or Type::getConstantScalarValues()')]
17: interface ConstantScalarType extends Type
18: {
19:
20: /** @return int|float|string|bool|null */
21: public function getValue();
22:
23: }
24: