88
99abstract class CommonStatus
1010{
11- public const SUBSPENDED = 'suspended ' ;
11+ public const SUSPENDED = 'suspended ' ;
1212
1313 public const ACTIVE = 'active ' ;
1414
1515 public const DELETED = 'deleted ' ;
1616
1717 final public function __construct (private string $ value )
1818 {
19- if (! in_array ($ value , [static ::SUBSPENDED , static ::ACTIVE , static ::DELETED ])) {
19+ if (! in_array ($ value , [static ::SUSPENDED , static ::ACTIVE , static ::DELETED ])) {
2020 throw BizException::make ('Invalid status: :status ' )
2121 ->with ('status ' , $ value );
2222 }
2323 }
2424
2525 public static function suspended (): static
2626 {
27- return new static (static ::SUBSPENDED );
27+ return new static (static ::SUSPENDED );
2828 }
2929
3030 public static function active (): static
@@ -44,7 +44,7 @@ public function isActive(): bool
4444
4545 public function isSuspended (): bool
4646 {
47- return $ this ->value === static ::SUBSPENDED ;
47+ return $ this ->value === static ::SUSPENDED ;
4848 }
4949
5050 public function isDeleted (): bool
@@ -55,8 +55,8 @@ public function isDeleted(): bool
5555 public function transitionTo (CommonStatus $ target ): static
5656 {
5757 $ validTransitions = match ($ this ->value ) {
58- static ::SUBSPENDED => [static ::ACTIVE , static ::DELETED ],
59- static ::ACTIVE => [static ::SUBSPENDED , static ::DELETED ],
58+ static ::SUSPENDED => [static ::ACTIVE , static ::DELETED ],
59+ static ::ACTIVE => [static ::SUSPENDED , static ::DELETED ],
6060 default => [],
6161 };
6262
0 commit comments