use assertion exception
Dieser Commit ist enthalten in:
Ursprung
e8da35995e
Commit
14a26a602b
@ -15,6 +15,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace D3\LinkmobilityClient;
|
||||
|
||||
use Assert\InvalidArgumentException;
|
||||
use D3\LinkmobilityClient\Request\RequestInterface;
|
||||
use D3\LinkmobilityClient\Url\Url;
|
||||
use D3\LinkmobilityClient\Url\UrlInterface;
|
||||
@ -25,7 +26,6 @@ use GuzzleHttp\HandlerStack;
|
||||
use GuzzleHttp\MessageFormatter;
|
||||
use GuzzleHttp\Middleware;
|
||||
use GuzzleRetry\GuzzleRetryMiddleware;
|
||||
use InvalidArgumentException;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
class Client
|
||||
|
@ -16,6 +16,7 @@ declare(strict_types=1);
|
||||
namespace D3\LinkmobilityClient\Request;
|
||||
|
||||
use Assert\Assert;
|
||||
use Assert\InvalidArgumentException;
|
||||
use D3\LinkmobilityClient\Client;
|
||||
use D3\LinkmobilityClient\Exceptions\ExceptionMessages;
|
||||
use D3\LinkmobilityClient\RecipientsList\RecipientsList;
|
||||
@ -26,7 +27,6 @@ use D3\LinkmobilityClient\ValueObject\Sender;
|
||||
use D3\LinkmobilityClient\ValueObject\SmsMessageAbstract;
|
||||
use D3\LinkmobilityClient\ValueObject\SmsMessageInterface;
|
||||
use GuzzleHttp\RequestOptions;
|
||||
use InvalidArgumentException;
|
||||
|
||||
abstract class Request implements RequestInterface
|
||||
{
|
||||
|
@ -15,10 +15,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace D3\LinkmobilityClient\Request;
|
||||
|
||||
use Assert\InvalidArgumentException;
|
||||
use D3\LinkmobilityClient\Client;
|
||||
use D3\LinkmobilityClient\RecipientsList\RecipientsListInterface;
|
||||
use D3\LinkmobilityClient\ValueObject\SmsMessageInterface;
|
||||
use InvalidArgumentException;
|
||||
use Psr\Http\Message\ResponseInterface as PsrResponseInterface;
|
||||
use D3\LinkmobilityClient\Response\ResponseInterface as LMResponseInterface;
|
||||
|
||||
|
@ -16,10 +16,10 @@ declare(strict_types=1);
|
||||
namespace D3\LinkmobilityClient\SMS;
|
||||
|
||||
use Assert\Assert;
|
||||
use Assert\InvalidArgumentException;
|
||||
use D3\LinkmobilityClient\Request\Request;
|
||||
use D3\LinkmobilityClient\Url\Url;
|
||||
use D3\LinkmobilityClient\ValueObject\SmsBinaryMessage;
|
||||
use InvalidArgumentException;
|
||||
|
||||
class BinaryRequest extends Request implements SmsRequestInterface
|
||||
{
|
||||
|
@ -16,10 +16,10 @@ declare(strict_types=1);
|
||||
namespace D3\LinkmobilityClient\SMS;
|
||||
|
||||
use Assert\Assert;
|
||||
use Assert\InvalidArgumentException;
|
||||
use D3\LinkmobilityClient\Request\Request;
|
||||
use D3\LinkmobilityClient\Url\Url;
|
||||
use D3\LinkmobilityClient\ValueObject\SmsTextMessage;
|
||||
use InvalidArgumentException;
|
||||
|
||||
class TextRequest extends Request implements SmsRequestInterface
|
||||
{
|
||||
|
@ -16,6 +16,7 @@ declare(strict_types=1);
|
||||
namespace D3\LinkmobilityClient\ValueObject;
|
||||
|
||||
use Assert\Assert;
|
||||
use Assert\InvalidArgumentException;
|
||||
use D3\LinkmobilityClient\Exceptions\ExceptionMessages;
|
||||
use D3\LinkmobilityClient\Exceptions\RecipientException;
|
||||
use libphonenumber\NumberParseException;
|
||||
@ -44,6 +45,7 @@ class Recipient extends StringValueObject
|
||||
*
|
||||
* @throws NumberParseException
|
||||
* @throws RecipientException
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function __construct(string $number, string $iso2CountryCode)
|
||||
{
|
||||
|
@ -16,6 +16,7 @@ declare(strict_types=1);
|
||||
namespace D3\LinkmobilityClient\ValueObject;
|
||||
|
||||
use Assert\Assert;
|
||||
use Assert\InvalidArgumentException;
|
||||
use D3\LinkmobilityClient\Exceptions\ExceptionMessages;
|
||||
use D3\LinkmobilityClient\Exceptions\NoSenderDefinedException;
|
||||
use D3\LinkmobilityClient\Exceptions\RecipientException;
|
||||
@ -32,6 +33,7 @@ class Sender extends ValueObject
|
||||
*
|
||||
* @throws NumberParseException
|
||||
* @throws RecipientException
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function __construct(string $number = null, string $iso2CountryCode = null)
|
||||
{
|
||||
|
@ -15,7 +15,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace D3\LinkmobilityClient\ValueObject;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use Assert\InvalidArgumentException;
|
||||
|
||||
class SmsTextMessage extends SmsMessageAbstract
|
||||
{
|
||||
|
@ -16,11 +16,16 @@ declare(strict_types=1);
|
||||
namespace D3\LinkmobilityClient\ValueObject;
|
||||
|
||||
use Assert\Assert;
|
||||
use Assert\InvalidArgumentException;
|
||||
|
||||
abstract class ValueObject
|
||||
{
|
||||
protected $value;
|
||||
|
||||
/**
|
||||
* @param string $number
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function __construct(string $number)
|
||||
{
|
||||
Assert::that($number)->notEmpty();
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren