-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
- Loading branch information
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file has been auto generated | ||
* Do not change it. | ||
*/ | ||
|
||
namespace Commercetools\Api\Models\Message; | ||
|
||
use Commercetools\Api\Models\Message\MessageCollection; | ||
use Commercetools\Exception\InvalidArgumentException; | ||
use stdClass; | ||
|
||
/** | ||
* @extends MessageCollection<AssociateRoleNameSetMessage> | ||
* @method AssociateRoleNameSetMessage current() | ||
* @method AssociateRoleNameSetMessage end() | ||
* @method AssociateRoleNameSetMessage at($offset) | ||
*/ | ||
class AssociateRoleNameSetMessageCollection extends MessageCollection | ||
{ | ||
/** | ||
* @psalm-assert AssociateRoleNameSetMessage $value | ||
* @psalm-param AssociateRoleNameSetMessage|stdClass $value | ||
* @throws InvalidArgumentException | ||
* | ||
* @return AssociateRoleNameSetMessageCollection | ||
*/ | ||
public function add($value) | ||
{ | ||
if (!$value instanceof AssociateRoleNameSetMessage) { | ||
throw new InvalidArgumentException(); | ||
Check warning on line 33 in lib/commercetools-api/src/Models/Message/AssociateRoleNameSetMessageCollection.php
|
||
} | ||
$this->store($value); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @psalm-return callable(int):?AssociateRoleNameSetMessage | ||
*/ | ||
protected function mapper() | ||
{ | ||
return function (?int $index): ?AssociateRoleNameSetMessage { | ||
$data = $this->get($index); | ||
if ($data instanceof stdClass) { | ||
Check warning on line 47 in lib/commercetools-api/src/Models/Message/AssociateRoleNameSetMessageCollection.php
|
||
/** @var AssociateRoleNameSetMessage $data */ | ||
$data = AssociateRoleNameSetMessageModel::of($data); | ||
$this->set($data, $index); | ||
Check warning on line 50 in lib/commercetools-api/src/Models/Message/AssociateRoleNameSetMessageCollection.php
|
||
} | ||
|
||
return $data; | ||
}; | ||
Check warning on line 54 in lib/commercetools-api/src/Models/Message/AssociateRoleNameSetMessageCollection.php
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file has been auto generated | ||
* Do not change it. | ||
*/ | ||
|
||
namespace Commercetools\Api\Models\Message; | ||
|
||
use Commercetools\Api\Models\Message\MessagePayloadCollection; | ||
use Commercetools\Exception\InvalidArgumentException; | ||
use stdClass; | ||
|
||
/** | ||
* @extends MessagePayloadCollection<AssociateRoleNameSetMessagePayload> | ||
* @method AssociateRoleNameSetMessagePayload current() | ||
* @method AssociateRoleNameSetMessagePayload end() | ||
* @method AssociateRoleNameSetMessagePayload at($offset) | ||
*/ | ||
class AssociateRoleNameSetMessagePayloadCollection extends MessagePayloadCollection | ||
{ | ||
/** | ||
* @psalm-assert AssociateRoleNameSetMessagePayload $value | ||
* @psalm-param AssociateRoleNameSetMessagePayload|stdClass $value | ||
* @throws InvalidArgumentException | ||
* | ||
* @return AssociateRoleNameSetMessagePayloadCollection | ||
*/ | ||
public function add($value) | ||
Check warning on line 30 in lib/commercetools-api/src/Models/Message/AssociateRoleNameSetMessagePayloadCollection.php
|
||
{ | ||
if (!$value instanceof AssociateRoleNameSetMessagePayload) { | ||
throw new InvalidArgumentException(); | ||
Check warning on line 33 in lib/commercetools-api/src/Models/Message/AssociateRoleNameSetMessagePayloadCollection.php
|
||
} | ||
$this->store($value); | ||
Check warning on line 35 in lib/commercetools-api/src/Models/Message/AssociateRoleNameSetMessagePayloadCollection.php
|
||
|
||
return $this; | ||
Check warning on line 37 in lib/commercetools-api/src/Models/Message/AssociateRoleNameSetMessagePayloadCollection.php
|
||
} | ||
|
||
/** | ||
* @psalm-return callable(int):?AssociateRoleNameSetMessagePayload | ||
*/ | ||
protected function mapper() | ||
Check warning on line 43 in lib/commercetools-api/src/Models/Message/AssociateRoleNameSetMessagePayloadCollection.php
|
||
{ | ||
return function (?int $index): ?AssociateRoleNameSetMessagePayload { | ||
$data = $this->get($index); | ||
if ($data instanceof stdClass) { | ||
Check warning on line 47 in lib/commercetools-api/src/Models/Message/AssociateRoleNameSetMessagePayloadCollection.php
|
||
/** @var AssociateRoleNameSetMessagePayload $data */ | ||
$data = AssociateRoleNameSetMessagePayloadModel::of($data); | ||
$this->set($data, $index); | ||
Check warning on line 50 in lib/commercetools-api/src/Models/Message/AssociateRoleNameSetMessagePayloadCollection.php
|
||
} | ||
|
||
return $data; | ||
}; | ||
Check warning on line 54 in lib/commercetools-api/src/Models/Message/AssociateRoleNameSetMessagePayloadCollection.php
|
||
} | ||
} |