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
3 changes: 2 additions & 1 deletion src/Collection/ProductCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
namespace WayForPay\SDK\Collection;

use Easy\Collections\ArrayList;
use InvalidArgumentException;
use WayForPay\SDK\Contract\SignatureAbleInterface;
use WayForPay\SDK\Domain\Product;

Expand All @@ -23,7 +24,7 @@ class ProductCollection extends ArrayList implements SignatureAbleInterface
public function add($item)
{
if (!$item instanceof Product) {
throw new \InvalidArgumentException('Expect Product, got ' . get_class($item));
throw new InvalidArgumentException('Expect Product, got ' . get_class($item));
}

return parent::add($item);
Expand Down
3 changes: 2 additions & 1 deletion src/Collection/TransactionHistoryCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
namespace WayForPay\SDK\Collection;

use Easy\Collections\ArrayList;
use InvalidArgumentException;
use WayForPay\SDK\Domain\TransactionHistory;

class TransactionHistoryCollection extends ArrayList
{
public function add($item)
{
if (!$item instanceof TransactionHistory) {
throw new \InvalidArgumentException('Expect Transaction, got ' . get_class($item));
throw new InvalidArgumentException('Expect Transaction, got ' . get_class($item));
}

return parent::add($item);
Expand Down
2 changes: 1 addition & 1 deletion src/Domain/PaymentSystems.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class PaymentSystems

/**
* PaymentSystems constructor.
* @param array $list
* @param $default
* @param $list
*/
public function __construct(array $list = array(), $default = null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Regular.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function __construct(
}

/**
* @return mixed
* @return array
*/
public function getModes()
{
Expand Down
3 changes: 1 addition & 2 deletions src/Form/PurchaseForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
namespace WayForPay\SDK\Form;

use DateTime;
use PFBC\Form;
use WayForPay\SDK\Collection\ProductCollection;
use WayForPay\SDK\Contract\EndpointInterface;
use WayForPay\SDK\Credential\AccountSecretCredential;
Expand Down Expand Up @@ -320,7 +319,7 @@ public function getData()
}

/**
* @return EndpointInterface|ApiEndpoint
* @return EndpointInterface
*/
public function getEndpoint()
{
Expand Down
5 changes: 3 additions & 2 deletions src/Request/ApiRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

namespace WayForPay\SDK\Request;

use Exception;
use WayForPay\SDK\Client\CurlRequestTransformer;
use WayForPay\SDK\Contract\EndpointInterface;
use WayForPay\SDK\Contract\RequestInterface;
Expand Down Expand Up @@ -134,7 +135,7 @@ public function send()
{
try {
return $this->getTransformer()->transform($this);
} catch (\Exception $e) {
} catch (Exception $e) {
throw new ApiException(new Reason(-1, $e->getMessage()));
}
}
Expand All @@ -144,7 +145,7 @@ abstract public function getResponseClass();
/**
* @param array $data
* @return ResponseInterface
* @throws \Exception
* @throws Exception
*/
public function getResponse(array $data)
{
Expand Down
2 changes: 0 additions & 2 deletions src/Response/SettleResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
namespace WayForPay\SDK\Response;

use WayForPay\SDK\Domain\Transaction;
use WayForPay\SDK\Domain\TransactionBase;
use WayForPay\SDK\Domain\TransactionService;
use WayForPay\SDK\Domain\TransactionSettle;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Response/TransactionListResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
class TransactionListResponse extends Response
{
/**
* @var ArrayList
* @var TransactionHistoryCollection|Transaction[]
*/
private $transactionList;

Expand Down
2 changes: 1 addition & 1 deletion src/Response/V2/TransactionListResponseV2.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
class TransactionListResponseV2 extends TransactionListResponse
{
/**
* @var ArrayList
* @var TransactionHistoryCollection|TransactionHistoryV2
*/
private $transactionList;

Expand Down
6 changes: 4 additions & 2 deletions src/Wizard/BaseWizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@

namespace WayForPay\SDK\Wizard;

use InvalidArgumentException;

abstract class BaseWizard
{
protected $propertyRequired = array();

/**
* @throws \InvalidArgumentException
* @throws InvalidArgumentException
*/
protected function check()
{
Expand All @@ -34,7 +36,7 @@ protected function check()
}

if ($missed) {
throw new \InvalidArgumentException(
throw new InvalidArgumentException(
'Some arguments missed: ' . implode(', ', $missed) .
'. Check next methods are called: ' . PHP_EOL . PHP_EOL . implode(PHP_EOL, $calls)
);
Expand Down
8 changes: 6 additions & 2 deletions src/Wizard/InvoiceWizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@

namespace WayForPay\SDK\Wizard;

use DateTime;
use WayForPay\SDK\Collection\ProductCollection;
use WayForPay\SDK\Credential\AccountSecretCredential;
use WayForPay\SDK\Domain\Client;
use WayForPay\SDK\Domain\PaymentSystems;
use WayForPay\SDK\Request\InvoiceRequest;

class InvoiceWizard extends RequestWizard
Expand Down Expand Up @@ -107,7 +111,7 @@ class InvoiceWizard extends RequestWizard
/**
* @param AccountSecretCredential $credential
*
* @return InvoceWizard
* @return InvoiceWizard
*/
public static function get(AccountSecretCredential $credential)
{
Expand Down Expand Up @@ -274,7 +278,7 @@ public function setLanguage($language)
}

/**
* @return RefundRequest
* @return InvoiceRequest
*/
public function getRequest()
{
Expand Down
1 change: 0 additions & 1 deletion src/Wizard/SettleWizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
namespace WayForPay\SDK\Wizard;

use WayForPay\SDK\Credential\AccountSecretCredential;
use WayForPay\SDK\Request\RefundRequest;
use WayForPay\SDK\Request\SettleRequest;

/**
Expand Down