Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/SubscribePro/Exception/HttpException.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class HttpException extends \RuntimeException
* @param int $code
* @param Exception|null $previous
*/
public function __construct(ResponseInterface $response, $code = 0, Exception $previous = null)
public function __construct(ResponseInterface $response, $code = 0, ?Exception $previous = null)
{
parent::__construct($this->getErrorMessage($response), $code, $previous);

Expand Down
2 changes: 1 addition & 1 deletion src/SubscribePro/Service/AbstractService.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct(Http $http, DataFactoryInterface $factory, array $co
*
* @return \SubscribePro\Service\DataInterface
*/
protected function retrieveItem($response, $entityName, DataInterface $item = null)
protected function retrieveItem($response, $entityName, ?DataInterface $item = null)
{
$itemData = !empty($response[$entityName]) ? $response[$entityName] : [];
$item = $item ? $item->importData($itemData) : $this->dataFactory->create($itemData);
Expand Down
2 changes: 1 addition & 1 deletion src/SubscribePro/Service/Address/AddressService.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* @see \SubscribePro\Service\Address\AddressInterface
*
* @method \SubscribePro\Service\Address\AddressInterface retrieveItem($response, $entityName, \SubscribePro\Service\DataInterface $item = null)
* @method \SubscribePro\Service\Address\AddressInterface retrieveItem($response, $entityName, ?\SubscribePro\Service\DataInterface $item = null)
* @method \SubscribePro\Service\Address\AddressInterface[] retrieveItems($response, $entitiesName)
*
* @property \SubscribePro\Service\Address\AddressFactory $dataFactory
Expand Down
2 changes: 1 addition & 1 deletion src/SubscribePro/Service/Customer/CustomerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* @see \SubscribePro\Service\Customer\CustomerInterface
*
* @method \SubscribePro\Service\Customer\CustomerInterface retrieveItem($response, $entityName, \SubscribePro\Service\DataInterface $item = null)
* @method \SubscribePro\Service\Customer\CustomerInterface retrieveItem($response, $entityName, ?\SubscribePro\Service\DataInterface $item = null)
* @method \SubscribePro\Service\Customer\CustomerInterface[] retrieveItems($response, $entitiesName)
*
* @property \SubscribePro\Service\Customer\CustomerFactory $dataFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @see \SubscribePro\Service\PaymentProfile\PaymentProfileInterface
*
* @method \SubscribePro\Service\PaymentProfile\PaymentProfileInterface retrieveItem($response, $entityName, \SubscribePro\Service\DataInterface $item = null)
* @method \SubscribePro\Service\PaymentProfile\PaymentProfileInterface retrieveItem($response, $entityName, ?\SubscribePro\Service\DataInterface $item = null)
* @method \SubscribePro\Service\PaymentProfile\PaymentProfileInterface[] retrieveItems($response, $entitiesName)
*
* @property \SubscribePro\Service\PaymentProfile\PaymentProfileFactory $dataFactory
Expand Down
2 changes: 1 addition & 1 deletion src/SubscribePro/Service/Product/ProductService.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* @see \SubscribePro\Service\Product\ProductInterface
*
* @method \SubscribePro\Service\Product\ProductInterface retrieveItem($response, $entityName, \SubscribePro\Service\DataInterface $item = null)
* @method \SubscribePro\Service\Product\ProductInterface retrieveItem($response, $entityName, ?\SubscribePro\Service\DataInterface $item = null)
* @method \SubscribePro\Service\Product\ProductInterface[] retrieveItems($response, $entitiesName)
*
* @property \SubscribePro\Service\Product\ProductFactory $dataFactory
Expand Down
2 changes: 1 addition & 1 deletion src/SubscribePro/Service/SalesOrder/SalesOrderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* @see \SubscribePro\Service\SalesOrder\SalesOrderInterface
*
* @method \SubscribePro\Service\SalesOrder\SalesOrderInterface retrieveItem($response, $entityName, \SubscribePro\Service\DataInterface $item = null)
* @method \SubscribePro\Service\SalesOrder\SalesOrderInterface retrieveItem($response, $entityName, ?\SubscribePro\Service\DataInterface $item = null)
* @method \SubscribePro\Service\SalesOrder\SalesOrderInterface[] retrieveItems($response, $entitiesName)
*
* @property \SubscribePro\Service\SalesOrder\SubscriptionFactory $dataFactory
Expand Down
4 changes: 2 additions & 2 deletions src/SubscribePro/Service/Subscription/SubscriptionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* @see \SubscribePro\Service\Subscription\SubscriptionInterface
*
* @method \SubscribePro\Service\Subscription\SubscriptionInterface retrieveItem($response, $entityName, \SubscribePro\Service\DataInterface $item = null)
* @method \SubscribePro\Service\Subscription\SubscriptionInterface retrieveItem($response, $entityName, ?\SubscribePro\Service\DataInterface $item = null)
* @method \SubscribePro\Service\Subscription\SubscriptionInterface[] retrieveItems($response, $entitiesName)
*
* @property \SubscribePro\Service\Subscription\SubscriptionFactory $dataFactory
Expand Down Expand Up @@ -47,7 +47,7 @@ public function createSubscription(array $subscriptionData = [])
* @throws \SubscribePro\Exception\EntityInvalidDataException
* @throws \SubscribePro\Exception\HttpException
*/
public function saveSubscription(SubscriptionInterface $subscription, array $metadata = null)
public function saveSubscription(SubscriptionInterface $subscription, ?array $metadata = null)
{
$url = $subscription->isNew() ? '/services/v2/subscription.json' : "/services/v2/subscriptions/{$subscription->getId()}.json";
$formData = $subscription->getFormData();
Expand Down
2 changes: 1 addition & 1 deletion src/SubscribePro/Service/Token/TokenService.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* @see \SubscribePro\Service\Token\TokenInterface
*
* @method \SubscribePro\Service\Token\TokenInterface retrieveItem($response, $entityName, \SubscribePro\Service\DataInterface $item = null)
* @method \SubscribePro\Service\Token\TokenInterface retrieveItem($response, $entityName, ?\SubscribePro\Service\DataInterface $item = null)
* @method \SubscribePro\Service\Token\TokenInterface[] retrieveItems($response, $entitiesName)
*
* @property \SubscribePro\Service\Token\TokenFactory $dataFactory
Expand Down
2 changes: 1 addition & 1 deletion src/SubscribePro/Service/Transaction/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function isVerifyDataValid()
*
* @return mixed[]
*/
public function getTokenFormData(AddressInterface $address = null)
public function getTokenFormData(?AddressInterface $address = null)
{
$tokenFormData = array_intersect_key($this->data, $this->createTokenFields);
if ($address) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function isServiceDataValid();
*
* @return mixed[]
*/
public function getTokenFormData(AddressInterface $address = null);
public function getTokenFormData(?AddressInterface $address = null);

/**
* @return bool
Expand Down
12 changes: 6 additions & 6 deletions src/SubscribePro/Service/Transaction/TransactionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @see \SubscribePro\Service\Transaction\TransactionInterface
*
* @method \SubscribePro\Service\Transaction\TransactionInterface retrieveItem($response, $entityName, \SubscribePro\Service\DataInterface $item = null)
* @method \SubscribePro\Service\Transaction\TransactionInterface retrieveItem($response, $entityName, ?\SubscribePro\Service\DataInterface $item = null)
* @method \SubscribePro\Service\Transaction\TransactionInterface[] retrieveItems($response, $entitiesName)
*
* @property \SubscribePro\Service\Transaction\TransactionFactory $dataFactory
Expand Down Expand Up @@ -90,7 +90,7 @@ public function verifyProfile($paymentProfileId, TransactionInterface $transacti
* @throws \SubscribePro\Exception\EntityInvalidDataException
* @throws \SubscribePro\Exception\HttpException
*/
public function verifyAndStoreToken($token, TransactionInterface $transaction, AddressInterface $address = null)
public function verifyAndStoreToken($token, TransactionInterface $transaction, ?AddressInterface $address = null)
{
if (!$transaction->isTokenDataValid()) {
throw new EntityInvalidDataException('Not all required Transaction fields are set');
Expand Down Expand Up @@ -175,7 +175,7 @@ public function purchaseByProfile($authorizeData, TransactionInterface $transact
* @throws \SubscribePro\Exception\EntityInvalidDataException
* @throws \SubscribePro\Exception\HttpException
*/
public function authorizeByToken($token, TransactionInterface $transaction, AddressInterface $address = null, $metadata = null)
public function authorizeByToken($token, TransactionInterface $transaction, ?AddressInterface $address = null, $metadata = null)
{
if (!$transaction->isTokenDataValid()) {
throw new EntityInvalidDataException('Not all required Transaction fields are set.');
Expand Down Expand Up @@ -205,7 +205,7 @@ public function authorizeByToken($token, TransactionInterface $transaction, Addr
* @throws \SubscribePro\Exception\EntityInvalidDataException
* @throws \SubscribePro\Exception\HttpException
*/
public function purchaseByToken($token, TransactionInterface $transaction, AddressInterface $address = null, $metadata = null)
public function purchaseByToken($token, TransactionInterface $transaction, ?AddressInterface $address = null, $metadata = null)
{
if (!$transaction->isTokenDataValid()) {
throw new EntityInvalidDataException('Not all required Transaction fields are set.');
Expand Down Expand Up @@ -234,7 +234,7 @@ public function purchaseByToken($token, TransactionInterface $transaction, Addre
* @throws \SubscribePro\Exception\EntityInvalidDataException
* @throws \SubscribePro\Exception\HttpException
*/
public function capture($transactionId, TransactionInterface $transaction = null, $metadata = null)
public function capture($transactionId, ?TransactionInterface $transaction = null, $metadata = null)
{
if ($transaction && !$transaction->isServiceDataValid()) {
throw new EntityInvalidDataException('Currency code not specified for given amount.');
Expand All @@ -259,7 +259,7 @@ public function capture($transactionId, TransactionInterface $transaction = null
* @throws \SubscribePro\Exception\EntityInvalidDataException
* @throws \SubscribePro\Exception\HttpException
*/
public function credit($transactionId, TransactionInterface $transaction = null, $metadata = null)
public function credit($transactionId, ?TransactionInterface $transaction = null, $metadata = null)
{
if ($transaction && !$transaction->isServiceDataValid()) {
throw new EntityInvalidDataException('Currency code not specified for given amount.');
Expand Down
2 changes: 1 addition & 1 deletion src/SubscribePro/Service/Webhook/WebhookService.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* Default value is \SubscribePro\Service\Webhook\Event\Destination\Endpoint
* @see \SubscribePro\Service\Webhook\Event\Destination\EndpointInterface
*
* @method \SubscribePro\Service\Webhook\EventInterface retrieveItem($response, $entityName, \SubscribePro\Service\DataInterface $item = null)
* @method \SubscribePro\Service\Webhook\EventInterface retrieveItem($response, $entityName, ?\SubscribePro\Service\DataInterface $item = null)
* @method \SubscribePro\Service\Webhook\EventInterface[] retrieveItems($response, $entitiesName)
*
* @property \SubscribePro\Service\Webhook\EventFactory $dataFactory
Expand Down