-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Setono\SyliusPeakWMSPlugin\Exception; | ||
|
||
final class WebhookRegistrationException extends \RuntimeException | ||
{ | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Setono\SyliusPeakWMSPlugin\Factory; | ||
|
||
use Setono\SyliusPeakWMSPlugin\Model\RegisteredWebhooksInterface; | ||
use Sylius\Component\Resource\Factory\FactoryInterface; | ||
|
||
final class RegisteredWebhooksFactory implements RegisteredWebhooksFactoryInterface | ||
{ | ||
public function __construct( | ||
/** @var FactoryInterface<RegisteredWebhooksInterface> $decoratedFactory */ | ||
private readonly FactoryInterface $decoratedFactory, | ||
Check failure on line 14 in src/Factory/RegisteredWebhooksFactory.php GitHub Actions / Static Code Analysis (PHP8.2 | Deps: lowest | SF~5.4.0)TooManyTemplateParams
Check failure on line 14 in src/Factory/RegisteredWebhooksFactory.php GitHub Actions / Static Code Analysis (PHP8.1 | Deps: lowest | SF~5.4.0)TooManyTemplateParams
|
||
) { | ||
} | ||
|
||
public function createNew(): RegisteredWebhooksInterface | ||
Check failure on line 18 in src/Factory/RegisteredWebhooksFactory.php GitHub Actions / Static Code Analysis (PHP8.2 | Deps: lowest | SF~5.4.0)MoreSpecificReturnType
Check failure on line 18 in src/Factory/RegisteredWebhooksFactory.php GitHub Actions / Static Code Analysis (PHP8.1 | Deps: lowest | SF~5.4.0)MoreSpecificReturnType
|
||
{ | ||
return $this->decoratedFactory->createNew(); | ||
Check failure on line 20 in src/Factory/RegisteredWebhooksFactory.php GitHub Actions / Static Code Analysis (PHP8.2 | Deps: lowest | SF~5.4.0)LessSpecificReturnStatement
Check failure on line 20 in src/Factory/RegisteredWebhooksFactory.php GitHub Actions / Static Code Analysis (PHP8.1 | Deps: lowest | SF~5.4.0)LessSpecificReturnStatement
|
||
} | ||
|
||
public function createFromData(string $version, array $webhooks): RegisteredWebhooksInterface | ||
{ | ||
$obj = $this->createNew(); | ||
$obj->setVersion($version); | ||
$obj->setWebhooks($webhooks); | ||
|
||
return $obj; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Setono\SyliusPeakWMSPlugin\Factory; | ||
|
||
use Setono\PeakWMS\DataTransferObject\Webhook\Webhook; | ||
use Setono\SyliusPeakWMSPlugin\Model\RegisteredWebhooksInterface; | ||
use Sylius\Component\Resource\Factory\FactoryInterface; | ||
|
||
/** | ||
* @extends FactoryInterface<RegisteredWebhooksInterface> | ||
*/ | ||
interface RegisteredWebhooksFactoryInterface extends FactoryInterface | ||
Check failure on line 14 in src/Factory/RegisteredWebhooksFactoryInterface.php GitHub Actions / Static Code Analysis (PHP8.2 | Deps: lowest | SF~5.4.0)TooManyTemplateParams
Check failure on line 14 in src/Factory/RegisteredWebhooksFactoryInterface.php GitHub Actions / Static Code Analysis (PHP8.1 | Deps: lowest | SF~5.4.0)TooManyTemplateParams
|
||
{ | ||
public function createNew(): RegisteredWebhooksInterface; | ||
|
||
/** | ||
* @param list<Webhook> $webhooks | ||
*/ | ||
public function createFromData(string $version, array $webhooks): RegisteredWebhooksInterface; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Setono\SyliusPeakWMSPlugin\Model; | ||
|
||
class UploadOrderRequest implements UploadOrderRequestInterface | ||
{ | ||
protected ?int $id = null; | ||
|
||
protected ?int $version = null; | ||
|
||
protected ?string $state = null; | ||
|
||
protected ?OrderInterface $order = null; | ||
|
||
public function getId(): ?int | ||
{ | ||
return $this->id; | ||
} | ||
|
||
public function getVersion(): ?int | ||
{ | ||
return $this->version; | ||
} | ||
|
||
public function setVersion(?int $version): void | ||
{ | ||
$this->version = $version; | ||
} | ||
|
||
public function getState(): ?string | ||
{ | ||
return $this->state; | ||
} | ||
|
||
public function setState(?string $state): void | ||
{ | ||
$this->state = $state; | ||
} | ||
|
||
public function getOrder(): ?OrderInterface | ||
{ | ||
return $this->order; | ||
} | ||
|
||
public function setOrder(?OrderInterface $order): void | ||
{ | ||
$this->order = $order; | ||
} | ||
} |