File tree Expand file tree Collapse file tree 10 files changed +21
-21
lines changed
Expand file tree Collapse file tree 10 files changed +21
-21
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,8 @@ final class Profile
5454 int $id,
5555 string $firstName,
5656 string|float|int|null $height,
57- ): self {
58- return new self (
57+ ): static {
58+ return new static (
5959 PositiveInt::fromInt($id),
6060 NonEmptyStr::fromString($firstName),
6161 $height !== null ? FloatNonNegative::fromString((string) $height) : null,
Original file line number Diff line number Diff line change @@ -98,17 +98,17 @@ readonly class EvenPositiveInt extends IntType
9898 }
9999
100100 /** @throws IntegerTypeException */
101- public static function fromInt(int $value): self
101+ public static function fromInt(int $value): static
102102 {
103- return new self ($value);
103+ return new static ($value);
104104 }
105105
106106 /** @throws IntegerTypeException */
107- public static function fromString(string $value): self
107+ public static function fromString(string $value): static
108108 {
109109 parent::assertIntegerString($value);
110110
111- return new self ((int) $value);
111+ return new static ((int) $value);
112112 }
113113}
114114
@@ -151,8 +151,8 @@ final class Profile
151151 ?string $middleName,
152152 ?string $birthDateAtom, // e.g. "2025-01-02T03:04:05+00:00"
153153 int|float|string|null $heightM
154- ): self {
155- return new self (
154+ ): static {
155+ return new static (
156156 IntegerPositive::fromInt($id),
157157 StringNonEmpty::fromString($firstName),
158158 StringNonEmpty::fromString($lastName),
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ public function toString(): string
1616 return $ this ->value () ? 'true ' : 'false ' ;
1717 }
1818
19- public static function fromBool (bool $ value ): self
19+ public static function fromBool (bool $ value ): static
2020 {
2121 return new static ($ value );
2222 }
Original file line number Diff line number Diff line change @@ -11,9 +11,9 @@ interface BoolTypeInterface
1111{
1212 public function value (): bool ;
1313
14- public static function fromString (string $ value ): self ;
14+ public static function fromString (string $ value ): static ;
1515
16- public static function fromBool (bool $ value ): self ;
16+ public static function fromBool (bool $ value ): static ;
1717
1818 public function toString (): string ;
1919}
Original file line number Diff line number Diff line change @@ -13,9 +13,9 @@ interface DateTimeTypeInterface
1313{
1414 public function value (): DateTimeImmutable ;
1515
16- public static function fromDateTime (DateTimeImmutable $ value ): self ;
16+ public static function fromDateTime (DateTimeImmutable $ value ): static ;
1717
1818 public function toString (): string ;
1919
20- public static function fromString (string $ value ): self ;
20+ public static function fromString (string $ value ): static ;
2121}
Original file line number Diff line number Diff line change @@ -11,9 +11,9 @@ interface FloatTypeInterface
1111{
1212 public function value (): float ;
1313
14- public static function fromFloat (float $ value ): self ;
14+ public static function fromFloat (float $ value ): static ;
1515
1616 public function toString (): string ;
1717
18- public static function fromString (string $ value ): self ;
18+ public static function fromString (string $ value ): static ;
1919}
Original file line number Diff line number Diff line change @@ -11,9 +11,9 @@ interface IntTypeInterface
1111{
1212 public function value (): int ;
1313
14- public static function fromInt (int $ value ): self ;
14+ public static function fromInt (int $ value ): static ;
1515
1616 public function toString (): string ;
1717
18- public static function fromString (string $ value ): self ;
18+ public static function fromString (string $ value ): static ;
1919}
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ interface StrTypeInterface
1111{
1212 public function value (): string ;
1313
14- public static function fromString (string $ value ): self ;
14+ public static function fromString (string $ value ): static ;
1515
1616 public function toString (): string ;
1717}
Original file line number Diff line number Diff line change 99 */
1010interface UndefinedTypeInterface
1111{
12- public static function create (): self ;
12+ public static function create (): static ;
1313
1414 public function value (): void ;
1515
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public function __construct(bool $value)
2727 $ this ->value = $ value ;
2828 }
2929
30- public static function tryFromString (string $ value ): self |UndefinedStandard
30+ public static function tryFromString (string $ value ): static |UndefinedStandard
3131 {
3232 try {
3333 return static ::fromString ($ value );
@@ -36,7 +36,7 @@ public static function tryFromString(string $value): self|UndefinedStandard
3636 }
3737 }
3838
39- public static function tryFromInt (int $ value ): self |UndefinedStandard
39+ public static function tryFromInt (int $ value ): static |UndefinedStandard
4040 {
4141 try {
4242 return static ::fromInt ($ value );
You can’t perform that action at this time.
0 commit comments