Четвёртая итерация Receipt
- 100% покрытие - элвисы в разных сеттерах
This commit is contained in:
@@ -17,12 +17,10 @@ use AtolOnline\Exceptions\{
|
||||
InvalidInnLengthException,
|
||||
InvalidPhoneException,
|
||||
TooLongClientNameException,
|
||||
TooLongEmailException
|
||||
};
|
||||
TooLongEmailException};
|
||||
use AtolOnline\Traits\{
|
||||
HasEmail,
|
||||
HasInn
|
||||
};
|
||||
HasInn};
|
||||
use JetBrains\PhpStorm\Pure;
|
||||
|
||||
/**
|
||||
@@ -94,7 +92,7 @@ final class Client extends Entity
|
||||
throw new TooLongClientNameException($name);
|
||||
}
|
||||
}
|
||||
$this->name = empty($name) ? null : $name;
|
||||
$this->name = $name ?: null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,7 @@ namespace AtolOnline\Entities;
|
||||
use AtolOnline\Constants\Constraints;
|
||||
use AtolOnline\Exceptions\{
|
||||
InvalidPhoneException,
|
||||
TooLongPayingAgentOperationException
|
||||
};
|
||||
TooLongPayingAgentOperationException};
|
||||
use AtolOnline\Traits\HasPhones;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
@@ -64,7 +63,7 @@ final class PayingAgent extends Entity
|
||||
throw new TooLongPayingAgentOperationException($operation);
|
||||
}
|
||||
}
|
||||
$this->operation = empty($operation) ? null : $operation;
|
||||
$this->operation = $operation ?: null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
@@ -340,7 +340,7 @@ class Receipt extends Entity
|
||||
throw new TooLongAddCheckPropException($add_check_props);
|
||||
}
|
||||
}
|
||||
$this->add_check_props = empty($add_check_props) ? null : $add_check_props;
|
||||
$this->add_check_props = $add_check_props ?: null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ trait HasEmail
|
||||
throw new InvalidEmailException($email);
|
||||
}
|
||||
}
|
||||
$this->email = empty($email) ? null : $email;
|
||||
$this->email = $email ?: null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ trait HasInn
|
||||
throw new InvalidInnLengthException($inn);
|
||||
}
|
||||
}
|
||||
$this->inn = empty($inn) ? null : $inn;
|
||||
$this->inn = $inn ?: null;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user