From aaac92e5a9118ae6418557dad60c754c59ca43f2 Mon Sep 17 00:00:00 2001 From: Romain Monteil Date: Thu, 14 Feb 2019 10:15:14 +0100 Subject: [PATCH] [n/a] add PHP 7.3 to travis, fix CS --- .travis.yml | 1 + CHANGELOG.md | 2 +- composer.json | 3 +- src/Api/Insights.php | 4 +-- src/Event/EventFactory.php | 2 +- src/Messenger.php | 4 +-- src/Model/Callback/AccountLinking.php | 4 +-- src/Model/Callback/Message.php | 8 ++--- src/Model/Callback/MessageEcho.php | 10 +++--- src/Model/Callback/Payment.php | 4 +-- .../Callback/Payment/PaymentCredential.php | 16 +++++----- .../Callback/Payment/RequestedUserInfo.php | 12 +++---- src/Model/Callback/PolicyEnforcement.php | 6 ++-- src/Model/Callback/Postback.php | 10 +++--- src/Model/Callback/PreCheckout.php | 4 +-- src/Model/Callback/Referral.php | 12 +++---- src/Model/Common/Address.php | 12 +++---- .../Common/Button/Payment/PaymentSummary.php | 2 +- src/Model/Common/Button/Share.php | 4 +-- src/Model/Common/Button/WebUrl.php | 6 ++-- src/Model/Data.php | 28 ++++++++-------- src/Model/Message/Attachment/File.php | 6 ++-- .../Template/AbstractAirlineTemplate.php | 2 +- .../Template/Airline/BoardingPass.php | 12 +++---- .../Template/Airline/FlightSchedule.php | 4 +-- .../Template/Airline/PassengerInfo.php | 2 +- .../Template/AirlineItineraryTemplate.php | 4 +-- .../Template/AirlineUpdateTemplate.php | 2 +- .../Template/Element/AbstractElement.php | 4 +-- .../Template/Element/GenericElement.php | 2 +- .../Template/Element/MediaElement.php | 6 ++-- .../Template/Element/ReceiptElement.php | 6 ++-- .../Template/Receipt/Adjustment.php | 4 +-- .../Attachment/Template/ReceiptTemplate.php | 4 +-- src/Model/Message/QuickReply.php | 6 ++-- src/Model/ProfileSettings.php | 14 ++++---- src/Model/ProfileSettings/PaymentSettings.php | 4 +-- src/Model/ThreadControl.php | 4 +-- src/Request/BroadcastRequest.php | 8 ++--- src/Request/CodeRequest.php | 4 +-- src/Request/InsightsRequest.php | 8 ++--- src/Request/PersonaRequest.php | 2 +- src/Request/ProfileRequest.php | 4 +-- src/Request/SendRequest.php | 14 ++++---- src/Response/BroadcastResponse.php | 8 ++--- src/Response/CodeResponse.php | 4 +-- src/Response/PersonaResponse.php | 14 ++++---- src/Response/ProfileResponse.php | 4 +-- src/Response/SendResponse.php | 32 +++++++++---------- src/Response/UserResponse.php | 24 +++++++------- 50 files changed, 183 insertions(+), 183 deletions(-) diff --git a/.travis.yml b/.travis.yml index 96c51e6..af02d7f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ cache: php: - 7.1 - 7.2 + - 7.3 env: global: diff --git a/CHANGELOG.md b/CHANGELOG.md index b29569c..af6ad4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ The Messenger library follows [SemVer](http://semver.org/). **Changelog** (since [`3.1.0`](https://github.com/ker0x/messenger/compare/3.1.0...3.1.1)) -- 3.1.0 (2018-10) +- 3.1.1 (2018-12) - Method `addQuickReply` will no longer thrown an exception if no quick replies were previously set (Thanks to @Khodl) - Add new tests for QuickReplies - Update `phpunit/phpunit` version to `7.4`. diff --git a/composer.json b/composer.json index a1034c0..b3689a5 100644 --- a/composer.json +++ b/composer.json @@ -27,8 +27,7 @@ }, "require-dev": { "phpunit/phpunit": "^7.4", - "friendsofphp/php-cs-fixer": "^2.5", - "codacy/coverage": "^1.4" + "friendsofphp/php-cs-fixer": "^2.5" }, "autoload": { "psr-4": { diff --git a/src/Api/Insights.php b/src/Api/Insights.php index 09c1927..8cc12fb 100644 --- a/src/Api/Insights.php +++ b/src/Api/Insights.php @@ -13,8 +13,8 @@ class Insights extends AbstractApi implements InsightsInterface { /** * @param array $metrics - * @param null|int $since - * @param null|int $until + * @param int|null $since + * @param int|null $until * * @throws \Kerox\Messenger\Exception\MessengerException * diff --git a/src/Event/EventFactory.php b/src/Event/EventFactory.php index 8f38837..406c0d0 100644 --- a/src/Event/EventFactory.php +++ b/src/Event/EventFactory.php @@ -33,7 +33,7 @@ class EventFactory public static function create(array $payload): AbstractEvent { foreach (array_keys($payload) as $key) { - if (array_key_exists($key, self::EVENTS)) { + if (\array_key_exists($key, self::EVENTS)) { $className = self::EVENTS[$key]; if (isset($payload['message']['is_echo'])) { $className = MessageEchoEvent::class; diff --git a/src/Messenger.php b/src/Messenger.php index 32e203c..bd64ece 100644 --- a/src/Messenger.php +++ b/src/Messenger.php @@ -51,7 +51,7 @@ class Messenger * @param string $verifyToken * @param string $pageToken * @param string $apiVersion - * @param null|\GuzzleHttp\ClientInterface $client + * @param \GuzzleHttp\ClientInterface|null $client */ public function __construct( string $appSecret, @@ -81,7 +81,7 @@ public function send(): Send } /** - * @param null|\Psr\Http\Message\ServerRequestInterface $request + * @param \Psr\Http\Message\ServerRequestInterface|null $request * * @return \Kerox\Messenger\Api\Webhook */ diff --git a/src/Model/Callback/AccountLinking.php b/src/Model/Callback/AccountLinking.php index 7b86913..cff6d59 100644 --- a/src/Model/Callback/AccountLinking.php +++ b/src/Model/Callback/AccountLinking.php @@ -12,7 +12,7 @@ class AccountLinking protected $status; /** - * @var null|string + * @var string|null */ protected $authorizationCode; @@ -45,7 +45,7 @@ public function hasAuthorizationCode(): bool } /** - * @return null|string + * @return string|null */ public function getAuthorizationCode(): ?string { diff --git a/src/Model/Callback/Message.php b/src/Model/Callback/Message.php index 2fce390..6be4e13 100644 --- a/src/Model/Callback/Message.php +++ b/src/Model/Callback/Message.php @@ -17,12 +17,12 @@ class Message protected $sequence; /** - * @var null|string + * @var string|null */ protected $text; /** - * @var null|string + * @var string|null */ protected $quickReply; @@ -79,7 +79,7 @@ public function getSequence(): int } /** - * @return null|string + * @return string|null */ public function getText(): ?string { @@ -95,7 +95,7 @@ public function hasText(): bool } /** - * @return null|string + * @return string|null */ public function getQuickReply(): ?string { diff --git a/src/Model/Callback/MessageEcho.php b/src/Model/Callback/MessageEcho.php index 890f3d5..f0cfff3 100644 --- a/src/Model/Callback/MessageEcho.php +++ b/src/Model/Callback/MessageEcho.php @@ -12,12 +12,12 @@ class MessageEcho extends Message protected $isEcho; /** - * @var null|int + * @var int|null */ protected $appId; /** - * @var null|string + * @var string|null */ protected $metadata; @@ -25,7 +25,7 @@ class MessageEcho extends Message * MessageEcho constructor. * * @param bool $isEcho - * @param null|int $appId + * @param int|null $appId * @param string $messageId * @param int $sequence * @param string|null $metadata @@ -59,7 +59,7 @@ public function isEcho(): bool } /** - * @return null|int + * @return int|null */ public function getAppId(): ?int { @@ -67,7 +67,7 @@ public function getAppId(): ?int } /** - * @return null|string + * @return string|null */ public function getMetadata(): ?string { diff --git a/src/Model/Callback/Payment.php b/src/Model/Callback/Payment.php index 5b8e586..1db6955 100644 --- a/src/Model/Callback/Payment.php +++ b/src/Model/Callback/Payment.php @@ -91,7 +91,7 @@ public function getPaymentCredential(): PaymentCredential } /** - * @return null|string + * @return string|null */ public function getCurrency(): ?string { @@ -99,7 +99,7 @@ public function getCurrency(): ?string } /** - * @return null|string + * @return string|null */ public function getAmount(): ?string { diff --git a/src/Model/Callback/Payment/PaymentCredential.php b/src/Model/Callback/Payment/PaymentCredential.php index e87169f..c296780 100644 --- a/src/Model/Callback/Payment/PaymentCredential.php +++ b/src/Model/Callback/Payment/PaymentCredential.php @@ -17,22 +17,22 @@ class PaymentCredential protected $chargeId; /** - * @var null|string + * @var string|null */ protected $tokenizedCard; /** - * @var null|string + * @var string|null */ protected $tokenizedCvv; /** - * @var null|string + * @var string|null */ protected $tokenExpiryMonth; /** - * @var null|string + * @var string|null */ protected $tokenExpiryYear; @@ -87,7 +87,7 @@ public function getChargeId(): string } /** - * @return null|string + * @return string|null */ public function getTokenizedCard(): ?string { @@ -95,7 +95,7 @@ public function getTokenizedCard(): ?string } /** - * @return null|string + * @return string|null */ public function getTokenizedCvv(): ?string { @@ -103,7 +103,7 @@ public function getTokenizedCvv(): ?string } /** - * @return null|string + * @return string|null */ public function getTokenExpiryMonth(): ?string { @@ -111,7 +111,7 @@ public function getTokenExpiryMonth(): ?string } /** - * @return null|string + * @return string|null */ public function getTokenExpiryYear(): ?string { diff --git a/src/Model/Callback/Payment/RequestedUserInfo.php b/src/Model/Callback/Payment/RequestedUserInfo.php index 4acb2d9..630647d 100644 --- a/src/Model/Callback/Payment/RequestedUserInfo.php +++ b/src/Model/Callback/Payment/RequestedUserInfo.php @@ -19,12 +19,12 @@ class RequestedUserInfo protected $contactName; /** - * @var null|string + * @var string|null */ protected $contactEmail; /** - * @var null|string + * @var string|null */ protected $contactPhone; @@ -33,8 +33,8 @@ class RequestedUserInfo * * @param \Kerox\Messenger\Model\Common\Address $shippingAddress * @param string $contactName - * @param null|string $contactEmail - * @param null|string $contactPhone + * @param string|null $contactEmail + * @param string|null $contactPhone */ public function __construct( Address $shippingAddress, @@ -65,7 +65,7 @@ public function getContactName(): string } /** - * @return null|string + * @return string|null */ public function getContactEmail(): ?string { @@ -73,7 +73,7 @@ public function getContactEmail(): ?string } /** - * @return null|string + * @return string|null */ public function getContactPhone(): ?string { diff --git a/src/Model/Callback/PolicyEnforcement.php b/src/Model/Callback/PolicyEnforcement.php index eb913f2..572f703 100644 --- a/src/Model/Callback/PolicyEnforcement.php +++ b/src/Model/Callback/PolicyEnforcement.php @@ -12,7 +12,7 @@ class PolicyEnforcement protected $action; /** - * @var null|string + * @var string|null */ protected $reason; @@ -20,7 +20,7 @@ class PolicyEnforcement * PolicyEnforcement constructor. * * @param string $action - * @param null|string $reason + * @param string|null $reason */ public function __construct(string $action, ?string $reason = null) { @@ -37,7 +37,7 @@ public function getAction(): string } /** - * @return null|string + * @return string|null */ public function getReason(): ?string { diff --git a/src/Model/Callback/Postback.php b/src/Model/Callback/Postback.php index 710a7e4..288d940 100644 --- a/src/Model/Callback/Postback.php +++ b/src/Model/Callback/Postback.php @@ -12,12 +12,12 @@ class Postback protected $title; /** - * @var null|string + * @var string|null */ protected $payload; /** - * @var null|\Kerox\Messenger\Model\Callback\Referral + * @var \Kerox\Messenger\Model\Callback\Referral|null */ protected $referral; @@ -25,7 +25,7 @@ class Postback * Postback constructor. * * @param string $title - * @param null|string $payload + * @param string|null $payload * @param \Kerox\Messenger\Model\Callback\Referral $referral */ public function __construct(string $title, ?string $payload = null, ?Referral $referral = null) @@ -52,7 +52,7 @@ public function hasPayload(): bool } /** - * @return null|string + * @return string|null */ public function getPayload(): ?string { @@ -68,7 +68,7 @@ public function hasReferral(): bool } /** - * @return null|\Kerox\Messenger\Model\Callback\Referral + * @return \Kerox\Messenger\Model\Callback\Referral|null */ public function getReferral(): ?Referral { diff --git a/src/Model/Callback/PreCheckout.php b/src/Model/Callback/PreCheckout.php index 071d478..a4f4bd9 100644 --- a/src/Model/Callback/PreCheckout.php +++ b/src/Model/Callback/PreCheckout.php @@ -63,7 +63,7 @@ public function getShippingAddress(): Address } /** - * @return null|string + * @return string|null */ public function getCurrency(): ?string { @@ -71,7 +71,7 @@ public function getCurrency(): ?string } /** - * @return null|string + * @return string|null */ public function getAmount(): ?string { diff --git a/src/Model/Callback/Referral.php b/src/Model/Callback/Referral.php index 1f83808..4e6e864 100644 --- a/src/Model/Callback/Referral.php +++ b/src/Model/Callback/Referral.php @@ -12,12 +12,12 @@ class Referral protected $ref; /** - * @var null|string + * @var string|null */ protected $source; /** - * @var null|string + * @var string|null */ protected $type; @@ -25,8 +25,8 @@ class Referral * Referral constructor. * * @param $ref - * @param null|string $source - * @param null|string $type + * @param string|null $source + * @param string|null $type */ public function __construct($ref, ?string $source, ?string $type) { @@ -44,7 +44,7 @@ public function getRef() } /** - * @return null|string + * @return string|null */ public function getSource(): ?string { @@ -52,7 +52,7 @@ public function getSource(): ?string } /** - * @return null|string + * @return string|null */ public function getType(): ?string { diff --git a/src/Model/Common/Address.php b/src/Model/Common/Address.php index 19fe989..0c00347 100644 --- a/src/Model/Common/Address.php +++ b/src/Model/Common/Address.php @@ -7,7 +7,7 @@ class Address implements \JsonSerializable { /** - * @var null|string + * @var string|null */ protected $name; @@ -17,7 +17,7 @@ class Address implements \JsonSerializable protected $street; /** - * @var null|string + * @var string|null */ protected $additionalStreet; @@ -42,7 +42,7 @@ class Address implements \JsonSerializable protected $country; /** - * @var null|int + * @var int|null */ protected $id; @@ -101,7 +101,7 @@ public function setName(string $name): self } /** - * @return null|string + * @return string|null */ public function getName(): ?string { @@ -129,7 +129,7 @@ public function setAdditionalStreet(string $additionalStreet): self } /** - * @return null|string + * @return string|null */ public function getAdditionalStreet(): ?string { @@ -181,7 +181,7 @@ public function setId(int $id): self } /** - * @return null|int + * @return int|null */ public function getId(): ?int { diff --git a/src/Model/Common/Button/Payment/PaymentSummary.php b/src/Model/Common/Button/Payment/PaymentSummary.php index 4e3dfd9..36cd031 100644 --- a/src/Model/Common/Button/Payment/PaymentSummary.php +++ b/src/Model/Common/Button/Payment/PaymentSummary.php @@ -23,7 +23,7 @@ class PaymentSummary implements \JsonSerializable protected $currency; /** - * @var null|bool + * @var bool|null */ protected $isTestPayment; diff --git a/src/Model/Common/Button/Share.php b/src/Model/Common/Button/Share.php index 5ed9f51..be65b45 100644 --- a/src/Model/Common/Button/Share.php +++ b/src/Model/Common/Button/Share.php @@ -12,14 +12,14 @@ class Share extends AbstractButton use UtilityTrait; /** - * @var null|\Kerox\Messenger\Model\Message\Attachment\Template\GenericTemplate + * @var \Kerox\Messenger\Model\Message\Attachment\Template\GenericTemplate|null */ protected $content; /** * Share constructor. * - * @param null|\Kerox\Messenger\Model\Message\Attachment\Template\GenericTemplate $content + * @param \Kerox\Messenger\Model\Message\Attachment\Template\GenericTemplate|null $content */ public function __construct(?GenericTemplate $content = null) { diff --git a/src/Model/Common/Button/WebUrl.php b/src/Model/Common/Button/WebUrl.php index 9a3817a..cd8f91b 100644 --- a/src/Model/Common/Button/WebUrl.php +++ b/src/Model/Common/Button/WebUrl.php @@ -28,17 +28,17 @@ class WebUrl extends AbstractButton protected $webviewHeightRatio; /** - * @var null|bool + * @var bool|null */ protected $messengerExtension; /** - * @var null|string + * @var string|null */ protected $fallbackUrl; /** - * @var null|string + * @var string|null */ protected $webviewShareButton; diff --git a/src/Model/Data.php b/src/Model/Data.php index c1eb481..7b210a1 100644 --- a/src/Model/Data.php +++ b/src/Model/Data.php @@ -9,12 +9,12 @@ class Data { /** - * @var null|string + * @var string|null */ protected $name; /** - * @var null|string + * @var string|null */ protected $period; @@ -24,27 +24,27 @@ class Data protected $values = []; /** - * @var null|string + * @var string|null */ protected $title; /** - * @var null|string + * @var string|null */ protected $description; /** - * @var null|string + * @var string|null */ protected $id; /** - * @var null|string + * @var string|null */ protected $tag; /** - * @var null|string + * @var string|null */ protected $profilePictureUrl; @@ -72,7 +72,7 @@ public function __construct(array $data) } /** - * @return null|string + * @return string|null */ public function getName(): ?string { @@ -80,7 +80,7 @@ public function getName(): ?string } /** - * @return null|string + * @return string|null */ public function getPeriod(): ?string { @@ -112,7 +112,7 @@ public function setValues(array $data): self } /** - * @return null|string + * @return string|null */ public function getTitle(): ?string { @@ -120,7 +120,7 @@ public function getTitle(): ?string } /** - * @return null|string + * @return string|null */ public function getDescription(): ?string { @@ -128,7 +128,7 @@ public function getDescription(): ?string } /** - * @return null|string + * @return string|null */ public function getId(): ?string { @@ -136,7 +136,7 @@ public function getId(): ?string } /** - * @return null|string + * @return string|null */ public function getTag(): ?string { @@ -144,7 +144,7 @@ public function getTag(): ?string } /** - * @return null|string + * @return string|null */ public function getProfilePictureUrl(): ?string { diff --git a/src/Model/Message/Attachment/File.php b/src/Model/Message/Attachment/File.php index 3555a2d..d99f7be 100644 --- a/src/Model/Message/Attachment/File.php +++ b/src/Model/Message/Attachment/File.php @@ -9,17 +9,17 @@ class File extends Attachment { /** - * @var null|string + * @var string|null */ protected $url; /** - * @var null|bool + * @var bool|null */ protected $reusable; /** - * @var null|string + * @var string|null */ protected $attachmentId; diff --git a/src/Model/Message/Attachment/Template/AbstractAirlineTemplate.php b/src/Model/Message/Attachment/Template/AbstractAirlineTemplate.php index c329a77..a8fc8fd 100644 --- a/src/Model/Message/Attachment/Template/AbstractAirlineTemplate.php +++ b/src/Model/Message/Attachment/Template/AbstractAirlineTemplate.php @@ -17,7 +17,7 @@ abstract class AbstractAirlineTemplate extends Template protected $locale; /** - * @var null|string + * @var string|null */ protected $themeColor; diff --git a/src/Model/Message/Attachment/Template/Airline/BoardingPass.php b/src/Model/Message/Attachment/Template/Airline/BoardingPass.php index 26f51a6..02efaba 100644 --- a/src/Model/Message/Attachment/Template/Airline/BoardingPass.php +++ b/src/Model/Message/Attachment/Template/Airline/BoardingPass.php @@ -22,12 +22,12 @@ class BoardingPass implements \JsonSerializable, TravelClassInterface protected $pnrNumber; /** - * @var null|string + * @var string|null */ protected $travelClass; /** - * @var null|string + * @var string|null */ protected $seat; @@ -47,22 +47,22 @@ class BoardingPass implements \JsonSerializable, TravelClassInterface protected $logoImageUrl; /** - * @var null|string + * @var string|null */ protected $headerImageUrl; /** - * @var null|string + * @var string|null */ protected $headerTextField; /** - * @var null|string + * @var string|null */ protected $qrCode; /** - * @var null|string + * @var string|null */ protected $barcodeImageUrl; diff --git a/src/Model/Message/Attachment/Template/Airline/FlightSchedule.php b/src/Model/Message/Attachment/Template/Airline/FlightSchedule.php index 4922d03..fd3db33 100644 --- a/src/Model/Message/Attachment/Template/Airline/FlightSchedule.php +++ b/src/Model/Message/Attachment/Template/Airline/FlightSchedule.php @@ -11,7 +11,7 @@ class FlightSchedule implements \JsonSerializable use ValidatorTrait; /** - * @var null|string + * @var string|null */ protected $boardingTime; @@ -21,7 +21,7 @@ class FlightSchedule implements \JsonSerializable protected $departureTime; /** - * @var null|string + * @var string|null */ protected $arrivalTime; diff --git a/src/Model/Message/Attachment/Template/Airline/PassengerInfo.php b/src/Model/Message/Attachment/Template/Airline/PassengerInfo.php index 5cf4cb9..c032c09 100644 --- a/src/Model/Message/Attachment/Template/Airline/PassengerInfo.php +++ b/src/Model/Message/Attachment/Template/Airline/PassengerInfo.php @@ -12,7 +12,7 @@ class PassengerInfo implements \JsonSerializable protected $passengerId; /** - * @var null|string + * @var string|null */ protected $ticketNumber; diff --git a/src/Model/Message/Attachment/Template/AirlineItineraryTemplate.php b/src/Model/Message/Attachment/Template/AirlineItineraryTemplate.php index 85c3144..439014a 100644 --- a/src/Model/Message/Attachment/Template/AirlineItineraryTemplate.php +++ b/src/Model/Message/Attachment/Template/AirlineItineraryTemplate.php @@ -39,12 +39,12 @@ class AirlineItineraryTemplate extends AbstractAirlineTemplate protected $priceInfo = []; /** - * @var null|string + * @var string|null */ protected $basePrice; /** - * @var null|string + * @var string|null */ protected $tax; diff --git a/src/Model/Message/Attachment/Template/AirlineUpdateTemplate.php b/src/Model/Message/Attachment/Template/AirlineUpdateTemplate.php index d22912a..75ce074 100644 --- a/src/Model/Message/Attachment/Template/AirlineUpdateTemplate.php +++ b/src/Model/Message/Attachment/Template/AirlineUpdateTemplate.php @@ -15,7 +15,7 @@ class AirlineUpdateTemplate extends AbstractAirlineTemplate public const UPDATE_TYPE_CANCELLATION = 'cancellation'; /** - * @var null|string + * @var string|null */ protected $introMessage; diff --git a/src/Model/Message/Attachment/Template/Element/AbstractElement.php b/src/Model/Message/Attachment/Template/Element/AbstractElement.php index abcbcc7..527966c 100644 --- a/src/Model/Message/Attachment/Template/Element/AbstractElement.php +++ b/src/Model/Message/Attachment/Template/Element/AbstractElement.php @@ -16,12 +16,12 @@ abstract class AbstractElement implements \JsonSerializable protected $title; /** - * @var null|string + * @var string|null */ protected $subtitle; /** - * @var null|string + * @var string|null */ protected $imageUrl; diff --git a/src/Model/Message/Attachment/Template/Element/GenericElement.php b/src/Model/Message/Attachment/Template/Element/GenericElement.php index d806e0c..ee3a8dd 100644 --- a/src/Model/Message/Attachment/Template/Element/GenericElement.php +++ b/src/Model/Message/Attachment/Template/Element/GenericElement.php @@ -14,7 +14,7 @@ class GenericElement extends AbstractElement protected $defaultAction; /** - * @var null|\Kerox\Messenger\Model\Common\Button\AbstractButton[] + * @var \Kerox\Messenger\Model\Common\Button\AbstractButton[]|null */ protected $buttons = []; diff --git a/src/Model/Message/Attachment/Template/Element/MediaElement.php b/src/Model/Message/Attachment/Template/Element/MediaElement.php index 512e2b1..f7cc99a 100644 --- a/src/Model/Message/Attachment/Template/Element/MediaElement.php +++ b/src/Model/Message/Attachment/Template/Element/MediaElement.php @@ -21,17 +21,17 @@ class MediaElement implements \JsonSerializable protected $mediaType; /** - * @var null|string + * @var string|null */ protected $attachmentId; /** - * @var null|string + * @var string|null */ protected $url; /** - * @var null|\Kerox\Messenger\Model\Common\Button\AbstractButton[] + * @var \Kerox\Messenger\Model\Common\Button\AbstractButton[]|null */ protected $buttons; diff --git a/src/Model/Message/Attachment/Template/Element/ReceiptElement.php b/src/Model/Message/Attachment/Template/Element/ReceiptElement.php index 0b39039..a71e81e 100644 --- a/src/Model/Message/Attachment/Template/Element/ReceiptElement.php +++ b/src/Model/Message/Attachment/Template/Element/ReceiptElement.php @@ -7,17 +7,17 @@ class ReceiptElement extends AbstractElement { /** - * @var null|int + * @var int|null */ protected $quantity; /** - * @var null|float + * @var float|null */ protected $price; /** - * @var null|string + * @var string|null */ protected $currency; diff --git a/src/Model/Message/Attachment/Template/Receipt/Adjustment.php b/src/Model/Message/Attachment/Template/Receipt/Adjustment.php index 7ac6647..005d897 100644 --- a/src/Model/Message/Attachment/Template/Receipt/Adjustment.php +++ b/src/Model/Message/Attachment/Template/Receipt/Adjustment.php @@ -7,12 +7,12 @@ class Adjustment implements \JsonSerializable { /** - * @var null|string + * @var string|null */ protected $name; /** - * @var null|float + * @var float|null */ protected $amount; diff --git a/src/Model/Message/Attachment/Template/ReceiptTemplate.php b/src/Model/Message/Attachment/Template/ReceiptTemplate.php index 2da06d1..333839e 100644 --- a/src/Model/Message/Attachment/Template/ReceiptTemplate.php +++ b/src/Model/Message/Attachment/Template/ReceiptTemplate.php @@ -46,7 +46,7 @@ class ReceiptTemplate extends Template protected $elements; /** - * @var null|\Kerox\Messenger\Model\Common\Address + * @var \Kerox\Messenger\Model\Common\Address|null */ protected $address; @@ -56,7 +56,7 @@ class ReceiptTemplate extends Template protected $summary; /** - * @var null|\Kerox\Messenger\Model\Message\Attachment\Template\Receipt\Adjustment[] + * @var \Kerox\Messenger\Model\Message\Attachment\Template\Receipt\Adjustment[]|null */ protected $adjustments; diff --git a/src/Model/Message/QuickReply.php b/src/Model/Message/QuickReply.php index f9f13d6..71134e0 100644 --- a/src/Model/Message/QuickReply.php +++ b/src/Model/Message/QuickReply.php @@ -22,17 +22,17 @@ class QuickReply implements \JsonSerializable protected $contentType; /** - * @var null|string + * @var string|null */ protected $title; /** - * @var null|string + * @var string|null */ protected $payload; /** - * @var null|string + * @var string|null */ protected $imageUrl; diff --git a/src/Model/ProfileSettings.php b/src/Model/ProfileSettings.php index ecd8b34..a7ade64 100644 --- a/src/Model/ProfileSettings.php +++ b/src/Model/ProfileSettings.php @@ -13,37 +13,37 @@ class ProfileSettings implements \JsonSerializable use ValidatorTrait; /** - * @var null|\Kerox\Messenger\Model\ProfileSettings\PersistentMenu[] + * @var \Kerox\Messenger\Model\ProfileSettings\PersistentMenu[]|null */ protected $persistentMenus; /** - * @var null|array + * @var array|null */ protected $startButton; /** - * @var null|\Kerox\Messenger\Model\ProfileSettings\Greeting[] + * @var \Kerox\Messenger\Model\ProfileSettings\Greeting[]|null */ protected $greetings; /** - * @var null|array + * @var array|null */ protected $whitelistedDomains; /** - * @var null|string + * @var string|null */ protected $accountLinkingUrl; /** - * @var null|\Kerox\Messenger\Model\ProfileSettings\PaymentSettings + * @var \Kerox\Messenger\Model\ProfileSettings\PaymentSettings|null */ protected $paymentSettings; /** - * @var null|\Kerox\Messenger\Model\ProfileSettings\TargetAudience + * @var \Kerox\Messenger\Model\ProfileSettings\TargetAudience|null */ protected $targetAudience; diff --git a/src/Model/ProfileSettings/PaymentSettings.php b/src/Model/ProfileSettings/PaymentSettings.php index e400554..467f765 100644 --- a/src/Model/ProfileSettings/PaymentSettings.php +++ b/src/Model/ProfileSettings/PaymentSettings.php @@ -11,12 +11,12 @@ class PaymentSettings implements \JsonSerializable use ValidatorTrait; /** - * @var null|string + * @var string|null */ protected $privacyUrl; /** - * @var null|string + * @var string|null */ protected $publicKey; diff --git a/src/Model/ThreadControl.php b/src/Model/ThreadControl.php index b8781b7..7c6b23a 100644 --- a/src/Model/ThreadControl.php +++ b/src/Model/ThreadControl.php @@ -16,12 +16,12 @@ class ThreadControl implements \JsonSerializable protected $recipientId; /** - * @var null|int + * @var int|null */ protected $targetAppId; /** - * @var null|string + * @var string|null */ protected $metadata; diff --git a/src/Request/BroadcastRequest.php b/src/Request/BroadcastRequest.php index 90d8521..c92816a 100644 --- a/src/Request/BroadcastRequest.php +++ b/src/Request/BroadcastRequest.php @@ -13,22 +13,22 @@ class BroadcastRequest extends AbstractRequest public const REQUEST_TYPE_ACTION = 'action'; /** - * @var null|string|\Kerox\Messenger\Model\Message + * @var string|\Kerox\Messenger\Model\Message|null */ protected $message; /** - * @var null|string + * @var string|null */ protected $messageCreativeId; /** - * @var null|string + * @var string|null */ protected $notificationType; /** - * @var null|string + * @var string|null */ protected $tag; diff --git a/src/Request/CodeRequest.php b/src/Request/CodeRequest.php index 281b850..bcfba87 100644 --- a/src/Request/CodeRequest.php +++ b/src/Request/CodeRequest.php @@ -21,7 +21,7 @@ class CodeRequest extends AbstractRequest protected $codeType; /** - * @var null|string + * @var string|null */ protected $ref; @@ -31,7 +31,7 @@ class CodeRequest extends AbstractRequest * @param string $pageToken * @param int $imageSize * @param string $codeType - * @param null|string $ref + * @param string|null $ref */ public function __construct(string $pageToken, int $imageSize, string $codeType, ?string $ref = null) { diff --git a/src/Request/InsightsRequest.php b/src/Request/InsightsRequest.php index a3aa701..73e46d8 100644 --- a/src/Request/InsightsRequest.php +++ b/src/Request/InsightsRequest.php @@ -16,12 +16,12 @@ class InsightsRequest extends AbstractRequest protected $metrics; /** - * @var null|int + * @var int|null */ protected $since; /** - * @var null|int + * @var int|null */ protected $until; @@ -30,8 +30,8 @@ class InsightsRequest extends AbstractRequest * * @param string $pageToken * @param array $metrics - * @param null|int $since - * @param null|int $until + * @param int|null $since + * @param int|null $until */ public function __construct(string $pageToken, array $metrics, ?int $since = null, ?int $until = null) { diff --git a/src/Request/PersonaRequest.php b/src/Request/PersonaRequest.php index fc368fa..b890257 100644 --- a/src/Request/PersonaRequest.php +++ b/src/Request/PersonaRequest.php @@ -9,7 +9,7 @@ class PersonaRequest extends AbstractRequest { /** - * @var null|\Kerox\Messenger\Model\PersonaSettings + * @var \Kerox\Messenger\Model\PersonaSettings|null */ protected $personaSettings; diff --git a/src/Request/ProfileRequest.php b/src/Request/ProfileRequest.php index b270086..7aaeb3b 100644 --- a/src/Request/ProfileRequest.php +++ b/src/Request/ProfileRequest.php @@ -27,7 +27,7 @@ public function __construct(string $pageToken, $profileSettings) } /** - * @return null|array + * @return array|null */ protected function buildHeaders(): ?array { @@ -39,7 +39,7 @@ protected function buildHeaders(): ?array } /** - * @return null|array|\Kerox\Messenger\Model\ProfileSettings + * @return array|\Kerox\Messenger\Model\ProfileSettings|null */ protected function buildBody() { diff --git a/src/Request/SendRequest.php b/src/Request/SendRequest.php index 3ba5762..15b9e75 100644 --- a/src/Request/SendRequest.php +++ b/src/Request/SendRequest.php @@ -13,32 +13,32 @@ class SendRequest extends AbstractRequest public const REQUEST_TYPE_ACTION = 'action'; /** - * @var null|array + * @var array|null */ protected $recipient; /** - * @var null|string|\Kerox\Messenger\Model\Message + * @var string|\Kerox\Messenger\Model\Message|null */ protected $message; /** - * @var null|string + * @var string|null */ protected $senderAction; /** - * @var null|string + * @var string|null */ protected $notificationType; /** - * @var null|string + * @var string|null */ protected $tag; /** - * @var null|string + * @var string|null */ protected $personaId; @@ -103,6 +103,6 @@ protected function buildBody(): array 'persona_id' => $this->personaId, ]; - return \array_filter($body); + return array_filter($body); } } diff --git a/src/Response/BroadcastResponse.php b/src/Response/BroadcastResponse.php index f890768..023b708 100644 --- a/src/Response/BroadcastResponse.php +++ b/src/Response/BroadcastResponse.php @@ -10,12 +10,12 @@ class BroadcastResponse extends AbstractResponse private const BROADCAST_ID = 'broadcast_id'; /** - * @var null|string + * @var string|null */ protected $messageCreativeId; /** - * @var null|string + * @var string|null */ protected $broadcastId; @@ -29,7 +29,7 @@ protected function parseResponse(array $response): void } /** - * @return null|string + * @return string|null */ public function getMessageCreativeId(): ?string { @@ -37,7 +37,7 @@ public function getMessageCreativeId(): ?string } /** - * @return null|string + * @return string|null */ public function getBroadcastId(): ?string { diff --git a/src/Response/CodeResponse.php b/src/Response/CodeResponse.php index d3f7b82..38bd76b 100644 --- a/src/Response/CodeResponse.php +++ b/src/Response/CodeResponse.php @@ -9,7 +9,7 @@ class CodeResponse extends AbstractResponse private const URI = 'uri'; /** - * @var null|string + * @var string|null */ protected $uri; @@ -22,7 +22,7 @@ protected function parseResponse(array $response): void } /** - * @return null|string + * @return string|null */ public function getUri(): ?string { diff --git a/src/Response/PersonaResponse.php b/src/Response/PersonaResponse.php index 56e02ca..e06405d 100644 --- a/src/Response/PersonaResponse.php +++ b/src/Response/PersonaResponse.php @@ -16,17 +16,17 @@ class PersonaResponse extends AbstractResponse private const PAGING = 'paging'; /** - * @var null|string + * @var string|null */ protected $id; /** - * @var null|string + * @var string|null */ protected $name; /** - * @var null|string + * @var string|null */ protected $profilePictureUrl; @@ -36,7 +36,7 @@ class PersonaResponse extends AbstractResponse protected $data = []; /** - * @var null|array + * @var array|null */ protected $paging; @@ -60,7 +60,7 @@ protected function parseResponse(array $response): void } /** - * @return null|string + * @return string|null */ public function getId(): ?string { @@ -68,7 +68,7 @@ public function getId(): ?string } /** - * @return null|string + * @return string|null */ public function getName(): ?string { @@ -76,7 +76,7 @@ public function getName(): ?string } /** - * @return null|string + * @return string|null */ public function getProfilePictureUrl(): ?string { diff --git a/src/Response/ProfileResponse.php b/src/Response/ProfileResponse.php index c779643..da3168e 100644 --- a/src/Response/ProfileResponse.php +++ b/src/Response/ProfileResponse.php @@ -9,7 +9,7 @@ class ProfileResponse extends AbstractResponse private const RESULT = 'result'; /** - * @var null|string + * @var string|null */ protected $result; @@ -22,7 +22,7 @@ protected function parseResponse(array $response): void } /** - * @return null|string + * @return string|null */ public function getResult(): ?string { diff --git a/src/Response/SendResponse.php b/src/Response/SendResponse.php index 8e42f3e..7736c3c 100644 --- a/src/Response/SendResponse.php +++ b/src/Response/SendResponse.php @@ -18,42 +18,42 @@ class SendResponse extends AbstractResponse private const ERROR_FBTRACE_ID = 'fbtrace_id'; /** - * @var null|string + * @var string|null */ protected $recipientId; /** - * @var null|string + * @var string|null */ protected $messageId; /** - * @var null|string + * @var string|null */ protected $attachmentId; /** - * @var null|string + * @var string|null */ protected $errorMessage; /** - * @var null|string + * @var string|null */ protected $errorType; /** - * @var null|int + * @var int|null */ protected $errorCode; /** - * @var null|int + * @var int|null */ protected $errorSubcode; /** - * @var null|string + * @var string|null */ protected $errorFbtraceId; @@ -90,7 +90,7 @@ private function hasError(array $response): bool } /** - * @return null|string + * @return string|null */ public function getRecipientId(): ?string { @@ -98,7 +98,7 @@ public function getRecipientId(): ?string } /** - * @return null|string + * @return string|null */ public function getMessageId(): ?string { @@ -106,7 +106,7 @@ public function getMessageId(): ?string } /** - * @return null|string + * @return string|null */ public function getAttachmentId(): ?string { @@ -114,7 +114,7 @@ public function getAttachmentId(): ?string } /** - * @return null|string + * @return string|null */ public function getErrorMessage(): ?string { @@ -122,7 +122,7 @@ public function getErrorMessage(): ?string } /** - * @return null|string + * @return string|null */ public function getErrorType(): ?string { @@ -130,7 +130,7 @@ public function getErrorType(): ?string } /** - * @return null|int + * @return int|null */ public function getErrorCode(): ?int { @@ -138,7 +138,7 @@ public function getErrorCode(): ?int } /** - * @return null|int + * @return int|null */ public function getErrorSubcode(): ?int { @@ -146,7 +146,7 @@ public function getErrorSubcode(): ?int } /** - * @return null|string + * @return string|null */ public function getErrorFbtraceId(): ?string { diff --git a/src/Response/UserResponse.php b/src/Response/UserResponse.php index 13ff417..c2b485f 100644 --- a/src/Response/UserResponse.php +++ b/src/Response/UserResponse.php @@ -9,32 +9,32 @@ class UserResponse extends AbstractResponse implements UserInterface { /** - * @var null|string + * @var string|null */ protected $firstName; /** - * @var null|string + * @var string|null */ protected $lastName; /** - * @var null|string + * @var string|null */ protected $profilePic; /** - * @var null|string + * @var string|null */ protected $locale; /** - * @var null|float + * @var float|null */ protected $timezone; /** - * @var null|string + * @var string|null */ protected $gender; @@ -52,7 +52,7 @@ protected function parseResponse(array $response): void } /** - * @return null|string + * @return string|null */ public function getFirstName(): ?string { @@ -60,7 +60,7 @@ public function getFirstName(): ?string } /** - * @return null|string + * @return string|null */ public function getLastName(): ?string { @@ -68,7 +68,7 @@ public function getLastName(): ?string } /** - * @return null|string + * @return string|null */ public function getProfilePic(): ?string { @@ -76,7 +76,7 @@ public function getProfilePic(): ?string } /** - * @return null|string + * @return string|null */ public function getLocale(): ?string { @@ -84,7 +84,7 @@ public function getLocale(): ?string } /** - * @return null|float + * @return float|null */ public function getTimezone(): ?float { @@ -92,7 +92,7 @@ public function getTimezone(): ?float } /** - * @return null|string + * @return string|null */ public function getGender(): ?string {