mirror of
https://github.com/opdavies/glassboxx-sdk-php.git
synced 2025-02-17 22:50:48 +00:00
Fix Psalm issues
This commit is contained in:
parent
ce05172932
commit
259946d961
6 changed files with 33 additions and 4 deletions
|
|
@ -8,13 +8,14 @@ use Opdavies\Glassboxx\Enum\InteractionType;
|
|||
use Opdavies\Glassboxx\Traits\UsesAuthTokenTrait;
|
||||
use Opdavies\Glassboxx\Traits\UsesCreatedAtTrait;
|
||||
use Opdavies\Glassboxx\ValueObject\OrderInterface;
|
||||
use RuntimeException;
|
||||
|
||||
class OrderRequest extends AbstractRequest implements OrderRequestInterface
|
||||
{
|
||||
use UsesCreatedAtTrait;
|
||||
use UsesAuthTokenTrait;
|
||||
|
||||
/** @var OrderInterface */
|
||||
/** @var OrderInterface|null */
|
||||
private $order;
|
||||
|
||||
public function forOrder(OrderInterface $order): AbstractRequest
|
||||
|
|
@ -26,6 +27,18 @@ class OrderRequest extends AbstractRequest implements OrderRequestInterface
|
|||
|
||||
public function execute(): string
|
||||
{
|
||||
if (!$this->config) {
|
||||
throw new RuntimeException('There is no config');
|
||||
}
|
||||
|
||||
if (!$this->order) {
|
||||
throw new RuntimeException('There is no order');
|
||||
}
|
||||
|
||||
if (!$this->order->getCustomer()) {
|
||||
throw new RuntimeException('There is no customer');
|
||||
}
|
||||
|
||||
$body = [
|
||||
'items' => [
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue