File tree Expand file tree Collapse file tree 11 files changed +103
-15
lines changed
Expand file tree Collapse file tree 11 files changed +103
-15
lines changed Original file line number Diff line number Diff line change 77use PhpTypedValues \Integer \IntegerPositive ;
88
99/**
10- * Alias of Positive integer used as identifier.
10+ * Alias for positive integer used as identifier.
1111 *
12- * Example "42"
12+ * Provides the same behavior as IntegerPositive but conveys the semantic
13+ * meaning of an application-level identifier. Useful where IDs are strictly
14+ * positive integers.
15+ *
16+ * Example
17+ * - $id = Id::fromString('42');
18+ * $id->value(); // 42
19+ * - $id = Id::fromInt(7);
20+ * (string) $id; // "7"
1321 *
1422 * @psalm-immutable
1523 */
Original file line number Diff line number Diff line change 77use PhpTypedValues \Integer \IntegerStandard ;
88
99/**
10+ * Alias for the generic integer-typed value.
11+ *
12+ * Provides the same behavior as IntegerStandard while offering a more
13+ * descriptive name for APIs that prefer "IntType".
14+ *
15+ * Example
16+ * - $v = IntType::fromString('7');
17+ * $v->toString(); // "7"
18+ * - $v = IntType::fromInt(42);
19+ * (string) $v; // "42"
20+ *
1021 * @psalm-immutable
1122 */
1223readonly class IntType extends IntegerStandard
Original file line number Diff line number Diff line change 77use PhpTypedValues \Integer \IntegerStandard ;
88
99/**
10+ * Alias for the generic integer-typed value.
11+ *
12+ * Provides the same behavior as IntegerStandard while offering a concise
13+ * descriptive name for APIs that prefer "Integer".
14+ *
15+ * Example
16+ * - $v = Integer::fromString('7');
17+ * $v->toString(); // "7"
18+ * - $v = Integer::fromInt(42);
19+ * (string) $v; // "42"
20+ *
1021 * @psalm-immutable
1122 */
1223readonly class Integer extends IntegerStandard
Original file line number Diff line number Diff line change 77use PhpTypedValues \Integer \MariaDb \IntegerTiny ;
88
99/**
10- * Alias of IntTiny .
10+ * Alias for MariaDB tiny integer type (signed TINYINT: -128..127) .
1111 *
12- * Example "1"
12+ * Provides the same behavior as IntegerTiny while exposing a concise name
13+ * suitable for APIs that prefer "Tiny" in the MariaDB namespace.
14+ *
15+ * Example
16+ * - $v = Tiny::fromInt(1);
17+ * $v->value(); // 1
18+ * - $v = Tiny::fromString('-5');
19+ * (string) $v; // "-5"
1320 *
1421 * @psalm-immutable
1522 */
Original file line number Diff line number Diff line change 77use PhpTypedValues \Integer \IntegerNonNegative ;
88
99/**
10- * Alias of Non- negative integer (>= 0).
10+ * Alias for non‑ negative integer (>= 0).
1111 *
12- * Example "0"
12+ * Provides the same behavior as IntegerNonNegative while exposing a concise
13+ * name suitable for APIs that prefer "NonNegative".
14+ *
15+ * Example
16+ * - $v = NonNegative::fromString('0');
17+ * $v->value(); // 0
18+ * - $v = NonNegative::fromInt(10);
19+ * (string) $v; // "10"
1320 *
1421 * @psalm-immutable
1522 */
Original file line number Diff line number Diff line change 77use PhpTypedValues \Integer \IntegerPositive ;
88
99/**
10- * Alias of Positive integer (> 0).
10+ * Alias for positive integer (> 0).
1111 *
12- * Example "1"
12+ * Provides the same behavior as IntegerPositive while exposing a concise
13+ * name suitable for APIs that prefer "Positive".
14+ *
15+ * Example
16+ * - $v = Positive::fromString('1');
17+ * $v->value(); // 1
18+ * - $v = Positive::fromInt(5);
19+ * (string) $v; // "5"
1320 *
1421 * @psalm-immutable
1522 */
Original file line number Diff line number Diff line change 1212use function sprintf ;
1313
1414/**
15- * Non- negative integer (>= 0).
15+ * Non‑ negative integer (>= 0).
1616 *
17- * Example "0"
17+ * Guarantees the wrapped integer is zero or positive. Provides factories from
18+ * strictly validated string and native int, along with standard formatting.
19+ *
20+ * Example
21+ * - $v = IntegerNonNegative::fromString('0');
22+ * $v->value(); // 0 (int)
23+ * - $v = IntegerNonNegative::fromInt(10);
24+ * (string) $v; // "10"
1825 *
1926 * @psalm-immutable
2027 */
Original file line number Diff line number Diff line change 1414/**
1515 * Positive integer (> 0).
1616 *
17- * Example "1"
17+ * Ensures the wrapped value is strictly greater than zero. Provides factories
18+ * from strictly validated string and native int, plus convenient formatting.
19+ *
20+ * Example
21+ * - $v = IntegerPositive::fromString('1');
22+ * $v->value(); // 1 (int)
23+ * - $v = IntegerPositive::fromInt(5);
24+ * (string) $v; // "5"
1825 *
1926 * @psalm-immutable
2027 */
Original file line number Diff line number Diff line change 1010use PhpTypedValues \Undefined \Alias \Undefined ;
1111
1212/**
13- * Represents any PHP integer.
13+ * Generic integer-typed value .
1414 *
15- * Example "-10"
15+ * Wraps any PHP integer and provides factories from a strictly validated
16+ * string or a native int, along with convenient string formatting.
17+ *
18+ * Example
19+ * - $v = IntegerStandard::fromString('-10');
20+ * $v->value(); // -10 (int)
21+ * - $v = IntegerStandard::fromInt(42);
22+ * (string) $v; // "42"
1623 *
1724 * @psalm-immutable
1825 */
Original file line number Diff line number Diff line change 1414/**
1515 * Week day number between 1 and 7.
1616 *
17- * Example "5"
17+ * Represents an integer constrained to the inclusive range 1..7 where
18+ * 1 = Monday and 7 = Sunday (or any convention your domain applies).
19+ * Factories accept strictly validated strings and native ints.
20+ *
21+ * Example
22+ * - $v = IntegerWeekDay::fromString('5');
23+ * $v->value(); // 5
24+ * - $v = IntegerWeekDay::fromInt(1);
25+ * (string) $v; // "1"
1826 *
1927 * @psalm-immutable
2028 */
You can’t perform that action at this time.
0 commit comments