File tree Expand file tree Collapse file tree 6 files changed +54
-0
lines changed
Expand file tree Collapse file tree 6 files changed +54
-0
lines changed Original file line number Diff line number Diff line change 77use PhpTypedValues \Undefined \UndefinedStandard ;
88
99/**
10+ * Implementation for a special "NotExist" typed value.
11+ *
12+ * Use it in APIs that must return a typed value when no meaningful value is available yet.
13+ * Prefer this over null to make intent explicit and keep type-safety.
14+ *
15+ * Example
16+ * - return NotExist::create();
17+ * - $v->toString(); // throws UndefinedTypeException
18+ *
1019 * @psalm-immutable
1120 */
1221readonly class NotExist extends UndefinedStandard
Original file line number Diff line number Diff line change 77use PhpTypedValues \Undefined \UndefinedStandard ;
88
99/**
10+ * Implementation for a special "NotFound" typed value.
11+ *
12+ * Use it in APIs that must return a typed value when no meaningful value is available yet.
13+ * Prefer this over null to make intent explicit and keep type-safety.
14+ *
15+ * Example
16+ * - return NotFound::create();
17+ * - $v->toString(); // throws UndefinedTypeException
18+ *
1019 * @psalm-immutable
1120 */
1221readonly class NotFound extends UndefinedStandard
Original file line number Diff line number Diff line change 77use PhpTypedValues \Undefined \UndefinedStandard ;
88
99/**
10+ * Implementation for a special "NotSet" typed value.
11+ *
12+ * Use it in APIs that must return a typed value when no meaningful value is available yet.
13+ * Prefer this over null to make intent explicit and keep type-safety.
14+ *
15+ * Example
16+ * - return NotSet::create();
17+ * - $v->toString(); // throws UndefinedTypeException
18+ *
1019 * @psalm-immutable
1120 */
1221readonly class NotSet extends UndefinedStandard
Original file line number Diff line number Diff line change 77use PhpTypedValues \Undefined \UndefinedStandard ;
88
99/**
10+ * Implementation for a special "Undefined" typed value.
11+ *
12+ * Use it in APIs that must return a typed value when no meaningful value is available yet.
13+ * Prefer this over null to make intent explicit and keep type-safety.
14+ *
15+ * Example
16+ * - return Undefined::create();
17+ * - $v->toString(); // throws UndefinedTypeException
18+ *
1019 * @psalm-immutable
1120 */
1221readonly class Undefined extends UndefinedStandard
Original file line number Diff line number Diff line change 77use PhpTypedValues \Undefined \UndefinedStandard ;
88
99/**
10+ * Implementation for a special "Unknown" typed value.
11+ *
12+ * Use it in APIs that must return a typed value when no meaningful value is available yet.
13+ * Prefer this over null to make intent explicit and keep type-safety.
14+ *
15+ * Example
16+ * - return Unknown::create();
17+ * - $v->toString(); // throws UndefinedTypeException
18+ *
1019 * @psalm-immutable
1120 */
1221readonly class Unknown extends UndefinedStandard
Original file line number Diff line number Diff line change 77use PhpTypedValues \Abstract \Undefined \UndefinedType ;
88
99/**
10+ * Base implementation for a special "UndefinedStandard" typed value.
11+ *
12+ * Use it in APIs that must return a typed value when no meaningful value is available yet.
13+ * Prefer this over null to make intent explicit and keep type-safety.
14+ *
15+ * Example
16+ * - return UndefinedStandard::create();
17+ * - $v->toString(); // throws UndefinedTypeException
18+ *
1019 * @psalm-immutable
1120 */
1221readonly class UndefinedStandard extends UndefinedType
You can’t perform that action at this time.
0 commit comments