You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems the setPayload tries to call an abstract parent::setPayload, should probably be removed.
namespaceReachDigital\Subscription\Model\ProductPlan {
finalclassSubmitFormGlobalScopeextends \Prooph\Common\Messaging\Command
{
use \Prooph\Common\Messaging\PayloadTrait;
protected$messageName = 'ReachDigital\Subscription\Model\ProductPlan\SubmitFormGlobalScope';
publicfunctionplanId(): PlanId
{
returnPlanId::fromString($this->payload['planId']);
}
publicfunctionproductId(): ProductId
{
returnProductId::fromScalar($this->payload['productId']);
}
publicfunctionenabled(): Enabled
{
returnEnabled::fromScalar($this->payload['enabled']);
}
publicfunctionenabledOnFrontend(): EnabledOnFrontend
{
returnEnabledOnFrontend::fromScalar($this->payload['enabledOnFrontend']);
}
publicfunctiontitle(): Title
{
returnTitle::fromString($this->payload['title']);
}
publicfunctiondescription(): Description
{
returnDescription::fromString($this->payload['description']);
}
publicfunctionschedule(): Schedule
{
returnSchedule::fromArray($this->payload['schedule']);
}
publicfunctioninterval(): Interval
{
returnInterval::fromArray($this->payload['interval']);
}
publicfunctioninitialPrice(): InitialPrice
{
returnInitialPrice::fromScalar($this->payload['initialPrice']);
}
publicfunctioninstallmentPrice(): InstallmentPrice
{
returnInstallmentPrice::fromScalar($this->payload['installmentPrice']);
}
publicstaticfunctionwith(PlanId$planId, ProductId$productId, Enabled$enabled, EnabledOnFrontend$enabledOnFrontend, Title$title, Description$description, Schedule$schedule, Interval$interval, InitialPrice$initialPrice, InstallmentPrice$installmentPrice): SubmitFormGlobalScope
{
returnnew self([
'planId' => $planId->toString(),
'productId' => $productId->toScalar(),
'enabled' => $enabled->toScalar(),
'enabledOnFrontend' => $enabledOnFrontend->toScalar(),
'title' => $title->toString(),
'description' => $description->toString(),
'schedule' => $schedule->toArray(),
'interval' => $interval->toArray(),
'initialPrice' => $initialPrice->toScalar(),
'installmentPrice' => $installmentPrice->toScalar(),
]);
}
protectedfunctionsetPayload(array$payload): void
{
if (! isset($payload['planId']) || ! is_string($payload['planId'])) {
thrownew \InvalidArgumentException("Key 'planId' is missing in payload or is not a string");
}
if (! isset($payload['productId']) || ! is_int($payload['productId'])) {
thrownew \InvalidArgumentException("Key 'productId' is missing in payload or is not a int");
}
if (! isset($payload['enabled']) || ! is_bool($payload['enabled'])) {
thrownew \InvalidArgumentException("Key 'enabled' is missing in payload or is not a bool");
}
if (! isset($payload['enabledOnFrontend']) || ! is_bool($payload['enabledOnFrontend'])) {
thrownew \InvalidArgumentException("Key 'enabledOnFrontend' is missing in payload or is not a bool");
}
if (! isset($payload['title']) || ! is_string($payload['title'])) {
thrownew \InvalidArgumentException("Key 'title' is missing in payload or is not a string");
}
if (! isset($payload['description']) || ! is_string($payload['description'])) {
thrownew \InvalidArgumentException("Key 'description' is missing in payload or is not a string");
}
if (! isset($payload['schedule']) || ! is_array($payload['schedule'])) {
thrownew \InvalidArgumentException("Key 'schedule' is missing in payload or is not an array");
}
if (! isset($payload['interval']) || ! is_array($payload['interval'])) {
thrownew \InvalidArgumentException("Key 'interval' is missing in payload or is not an array");
}
if (! isset($payload['initialPrice']) || ! is_float($payload['initialPrice'])) {
thrownew \InvalidArgumentException("Key 'initialPrice' is missing in payload or is not a float");
}
if (! isset($payload['installmentPrice']) || ! is_float($payload['installmentPrice'])) {
thrownew \InvalidArgumentException("Key 'installmentPrice' is missing in payload or is not a float");
}
parent::setPayload($payload);
}
}
}
The text was updated successfully, but these errors were encountered:
It seems the setPayload tries to call an abstract parent::setPayload, should probably be removed.
The text was updated successfully, but these errors were encountered: