mirror of
https://github.com/anthonyaxenov/atol-online.git
synced 2024-11-22 09:14:34 +00:00
AgentInfo
: перенос валидации типа агента из конструктора в сеттер
This commit is contained in:
parent
f548032843
commit
9d2617858d
@ -56,7 +56,7 @@ class AgentInfo extends Entity
|
|||||||
?ReceivePaymentsOperator $receive_payments_operator = null,
|
?ReceivePaymentsOperator $receive_payments_operator = null,
|
||||||
?MoneyTransferOperator $money_transfer_operator = null,
|
?MoneyTransferOperator $money_transfer_operator = null,
|
||||||
) {
|
) {
|
||||||
!is_null($type) && AgentTypes::isValid($type) && $this->setType($type);
|
!is_null($type) && $this->setType($type);
|
||||||
!is_null($paying_agent) && $this->setPayingAgent($paying_agent);
|
!is_null($paying_agent) && $this->setPayingAgent($paying_agent);
|
||||||
!is_null($receive_payments_operator) && $this->setReceivePaymentsOperator($receive_payments_operator);
|
!is_null($receive_payments_operator) && $this->setReceivePaymentsOperator($receive_payments_operator);
|
||||||
!is_null($money_transfer_operator) && $this->setMoneyTransferOperator($money_transfer_operator);
|
!is_null($money_transfer_operator) && $this->setMoneyTransferOperator($money_transfer_operator);
|
||||||
@ -77,10 +77,11 @@ class AgentInfo extends Entity
|
|||||||
*
|
*
|
||||||
* @param string|null $type
|
* @param string|null $type
|
||||||
* @return AgentInfo
|
* @return AgentInfo
|
||||||
|
* @throws InvalidEnumValueException
|
||||||
*/
|
*/
|
||||||
public function setType(?string $type): AgentInfo
|
public function setType(?string $type): AgentInfo
|
||||||
{
|
{
|
||||||
$this->type = $type;
|
AgentTypes::isValid($type) && $this->type = $type;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user