8
0

use assertion exception

Dieser Commit ist enthalten in:
Daniel Seifert 2023-02-02 00:07:12 +01:00
Ursprung e8da35995e
Commit 14a26a602b
Signiert von: DanielS
GPG-Schlüssel-ID: 6A513E13AEE66170
9 geänderte Dateien mit 15 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -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

Datei anzeigen

@ -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
{

Datei anzeigen

@ -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;

Datei anzeigen

@ -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
{

Datei anzeigen

@ -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
{

Datei anzeigen

@ -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)
{

Datei anzeigen

@ -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)
{

Datei anzeigen

@ -15,7 +15,7 @@ declare(strict_types=1);
namespace D3\LinkmobilityClient\ValueObject;
use InvalidArgumentException;
use Assert\InvalidArgumentException;
class SmsTextMessage extends SmsMessageAbstract
{

Datei anzeigen

@ -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();