We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b6a488 commit 302f89dCopy full SHA for 302f89d
src/customer/Customer.php
@@ -89,7 +89,7 @@ public function getState(): ?string
89
90
public function isDeleted(): bool
91
{
92
- return $this->state === 'deleted';
+ return CustomerState::isDeleted($this);
93
}
94
95
public static function fromArray(array $info)
src/customer/CustomerState.php
@@ -0,0 +1,13 @@
1
+<?php declare(strict_types=1);
2
+
3
+namespace hiqdev\php\billing\customer;
4
5
+enum CustomerState: string
6
+{
7
+ case DELETED = 'deleted';
8
9
+ public static function isDeleted(CustomerInterface $customer): bool
10
+ {
11
+ return self::tryFrom((string)$customer->getState()) === self::DELETED;
12
+ }
13
+}
0 commit comments