@@ -89,6 +89,9 @@ |
||
| 89 | 89 | return $this->requestUrl; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | + /** |
|
| 93 | + * @param string $apiUrl |
|
| 94 | + */ |
|
| 92 | 95 | private function download($apiUrl /* ... params */) |
| 93 | 96 | { |
| 94 | 97 | $args = func_get_args(); |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace h4kuna\Fio; |
| 4 | 4 | |
| 5 | -use h4kuna\Fio\Response\Read\TransactionList, |
|
| 6 | - h4kuna\Fio\Utils; |
|
| 5 | +use h4kuna\Fio\Response\Read\TransactionList; |
|
| 6 | +use h4kuna\Fio\Utils; |
|
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * Read from informtion Fio account |
@@ -93,7 +93,7 @@ |
||
| 93 | 93 | { |
| 94 | 94 | $args = func_get_args(); |
| 95 | 95 | $args[0] = $token = $this->account->getToken(); |
| 96 | - $this->requestUrl = self::REST_URL . vsprintf($apiUrl, $args); |
|
| 96 | + $this->requestUrl = self::REST_URL.vsprintf($apiUrl, $args); |
|
| 97 | 97 | return $this->queue->download($token, $this->requestUrl); |
| 98 | 98 | } |
| 99 | 99 | |
@@ -2,9 +2,9 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace h4kuna\Fio\Request\Pay\Payment; |
| 4 | 4 | |
| 5 | -use h4kuna\Fio, |
|
| 6 | - h4kuna\Fio\Account, |
|
| 7 | - h4kuna\Fio\Utils; |
|
| 5 | +use h4kuna\Fio; |
|
| 6 | +use h4kuna\Fio\Account; |
|
| 7 | +use h4kuna\Fio\Utils; |
|
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | 10 | * @author Milan Matějček |
@@ -159,7 +159,7 @@ |
||
| 159 | 159 | { |
| 160 | 160 | static $types = [self::PAYMENT_STANDARD, self::PAYMENT_PRIORITY]; |
| 161 | 161 | if (!in_array($type, $types)) { |
| 162 | - throw new Fio\InvalidArgumentException('Unsupported payment type: ' . $type); |
|
| 162 | + throw new Fio\InvalidArgumentException('Unsupported payment type: '.$type); |
|
| 163 | 163 | } |
| 164 | 164 | $this->paymentType = $type; |
| 165 | 165 | return $this; |
@@ -49,11 +49,11 @@ discard block |
||
| 49 | 49 | $this->setCurrency('EUR'); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * @param string $accountTo ISO 13616 |
|
| 54 | - * @return Euro |
|
| 55 | - * @throws Fio\InvalidArgumentException |
|
| 56 | - */ |
|
| 52 | + /** |
|
| 53 | + * @param string $accountTo ISO 13616 |
|
| 54 | + * @return Euro |
|
| 55 | + * @throws Fio\InvalidArgumentException |
|
| 56 | + */ |
|
| 57 | 57 | public function setAccountTo($accountTo) |
| 58 | 58 | { |
| 59 | 59 | if (strlen($accountTo) > 34) { |
@@ -97,11 +97,11 @@ discard block |
||
| 97 | 97 | return $this; |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - /** |
|
| 101 | - * @param string $benefCountry |
|
| 102 | - * @return self |
|
| 103 | - * @throws Fio\InvalidArgumentException |
|
| 104 | - */ |
|
| 100 | + /** |
|
| 101 | + * @param string $benefCountry |
|
| 102 | + * @return self |
|
| 103 | + * @throws Fio\InvalidArgumentException |
|
| 104 | + */ |
|
| 105 | 105 | public function setCountry($benefCountry) |
| 106 | 106 | { |
| 107 | 107 | $country = strtoupper($benefCountry); |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace h4kuna\Fio\Request\Pay\Payment; |
| 4 | 4 | |
| 5 | -use h4kuna\Fio, |
|
| 6 | - h4kuna\Fio\Utils; |
|
| 5 | +use h4kuna\Fio; |
|
| 6 | +use h4kuna\Fio\Utils; |
|
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * @author Milan Matějček |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | { |
| 36 | 36 | static $types = [self::PAYMENT_STANDARD, self::PAYMENT_FAST, self::PAYMENT_PRIORITY, self::PAYMENT_COLLECTION]; |
| 37 | 37 | if (!in_array($type, $types)) { |
| 38 | - throw new Fio\InvalidArgumentException('Unsupported payment type: ' . $type); |
|
| 38 | + throw new Fio\InvalidArgumentException('Unsupported payment type: '.$type); |
|
| 39 | 39 | } |
| 40 | 40 | $this->paymentType = $type; |
| 41 | 41 | return $this; |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
| 119 | - * @param string|DateTime $str |
|
| 119 | + * @param string $str |
|
| 120 | 120 | * @return self |
| 121 | 121 | */ |
| 122 | 122 | public function setDate($str) |
@@ -173,6 +173,9 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | abstract protected function getExpectedProperty(); |
| 175 | 175 | |
| 176 | + /** |
|
| 177 | + * @return string |
|
| 178 | + */ |
|
| 176 | 179 | abstract public function getStartXmlElement(); |
| 177 | 180 | |
| 178 | 181 | private function getProperties() |
@@ -2,11 +2,11 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace h4kuna\Fio\Request\Pay\Payment; |
| 4 | 4 | |
| 5 | -use h4kuna\Fio, |
|
| 6 | - h4kuna\Fio\Account, |
|
| 7 | - h4kuna\Fio\Utils, |
|
| 8 | - Iterator, |
|
| 9 | - Nette\Utils\DateTime; |
|
| 5 | +use h4kuna\Fio; |
|
| 6 | +use h4kuna\Fio\Account; |
|
| 7 | +use h4kuna\Fio\Utils; |
|
| 8 | +use Iterator; |
|
| 9 | +use Nette\Utils\DateTime; |
|
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | 12 | * @author Milan Matějček |
@@ -194,7 +194,7 @@ |
||
| 194 | 194 | public function current() |
| 195 | 195 | { |
| 196 | 196 | $property = $this->key(); |
| 197 | - $method = 'get' . ucfirst($property); |
|
| 197 | + $method = 'get'.ucfirst($property); |
|
| 198 | 198 | if (method_exists($this, $method)) { |
| 199 | 199 | return $this->{$method}(); |
| 200 | 200 | } |
@@ -61,10 +61,10 @@ discard block |
||
| 61 | 61 | $this->setDate('now'); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * @return self |
|
| 66 | - * @throws Fio\InvalidArgumentException |
|
| 67 | - */ |
|
| 64 | + /** |
|
| 65 | + * @return self |
|
| 66 | + * @throws Fio\InvalidArgumentException |
|
| 67 | + */ |
|
| 68 | 68 | public function setAmount($val) |
| 69 | 69 | { |
| 70 | 70 | $this->amount = floatval($val); |
@@ -80,12 +80,12 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | abstract public function setAccountTo($accountTo); |
| 82 | 82 | |
| 83 | - /** |
|
| 84 | - * Currency code ISO 4217. |
|
| 85 | - * @param string $code case insensitive |
|
| 86 | - * @return self |
|
| 87 | - * @throws Fio\InvalidArgumentException |
|
| 88 | - */ |
|
| 83 | + /** |
|
| 84 | + * Currency code ISO 4217. |
|
| 85 | + * @param string $code case insensitive |
|
| 86 | + * @return self |
|
| 87 | + * @throws Fio\InvalidArgumentException |
|
| 88 | + */ |
|
| 89 | 89 | public function setCurrency($code) |
| 90 | 90 | { |
| 91 | 91 | if (!preg_match('~[a-z]{3}~i', $code)) { |
@@ -95,11 +95,11 @@ discard block |
||
| 95 | 95 | return $this; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - /** |
|
| 99 | - * @param string $ks |
|
| 100 | - * @return self |
|
| 101 | - * @throws Fio\InvalidArgumentException |
|
| 102 | - */ |
|
| 98 | + /** |
|
| 99 | + * @param string $ks |
|
| 100 | + * @return self |
|
| 101 | + * @throws Fio\InvalidArgumentException |
|
| 102 | + */ |
|
| 103 | 103 | public function setConstantSymbol($ks) |
| 104 | 104 | { |
| 105 | 105 | if (!$ks) { |
@@ -131,10 +131,10 @@ discard block |
||
| 131 | 131 | return $this; |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - /** |
|
| 135 | - * @return self |
|
| 136 | - * @throws Fio\InvalidArgumentException |
|
| 137 | - */ |
|
| 134 | + /** |
|
| 135 | + * @return self |
|
| 136 | + * @throws Fio\InvalidArgumentException |
|
| 137 | + */ |
|
| 138 | 138 | public function setPaymentReason($code) |
| 139 | 139 | { |
| 140 | 140 | if (!$code) { |
@@ -146,11 +146,11 @@ discard block |
||
| 146 | 146 | return $this; |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | - /** |
|
| 150 | - * @param string $ss |
|
| 151 | - * @return self |
|
| 152 | - * @throws Fio\InvalidArgumentException |
|
| 153 | - */ |
|
| 149 | + /** |
|
| 150 | + * @param string $ss |
|
| 151 | + * @return self |
|
| 152 | + * @throws Fio\InvalidArgumentException |
|
| 153 | + */ |
|
| 154 | 154 | public function setSpecificSymbol($ss) |
| 155 | 155 | { |
| 156 | 156 | if (!$ss) { |
@@ -162,11 +162,11 @@ discard block |
||
| 162 | 162 | return $this; |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - /** |
|
| 166 | - * @param string|int $vs |
|
| 167 | - * @return self |
|
| 168 | - * @throws Fio\InvalidArgumentException |
|
| 169 | - */ |
|
| 165 | + /** |
|
| 166 | + * @param string|int $vs |
|
| 167 | + * @return self |
|
| 168 | + * @throws Fio\InvalidArgumentException |
|
| 169 | + */ |
|
| 170 | 170 | public function setVariableSymbol($vs) |
| 171 | 171 | { |
| 172 | 172 | if (!$vs) { |
@@ -20,6 +20,9 @@ |
||
| 20 | 20 | /** @var string */ |
| 21 | 21 | private $temp; |
| 22 | 22 | |
| 23 | + /** |
|
| 24 | + * @param string $temp |
|
| 25 | + */ |
|
| 23 | 26 | public function __construct($temp) |
| 24 | 27 | { |
| 25 | 28 | $this->temp = $temp; |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace h4kuna\Fio\Request\Pay; |
| 4 | 4 | |
| 5 | -use h4kuna\Fio\Request\Pay\Payment, |
|
| 6 | - XMLWriter; |
|
| 5 | +use h4kuna\Fio\Request\Pay\Payment; |
|
| 6 | +use XMLWriter; |
|
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * @author Milan Matějček |
@@ -40,9 +40,9 @@ |
||
| 40 | 40 | /** @return string */ |
| 41 | 41 | public function getPathname() |
| 42 | 42 | { |
| 43 | - $filename = $this->temp . DIRECTORY_SEPARATOR . md5(microtime(true)) . '.xml'; |
|
| 43 | + $filename = $this->temp.DIRECTORY_SEPARATOR.md5(microtime(true)).'.xml'; |
|
| 44 | 44 | file_put_contents($filename, $this->getXml()); |
| 45 | - register_shutdown_function(function () use ($filename) { |
|
| 45 | + register_shutdown_function(function() use ($filename) { |
|
| 46 | 46 | @unlink($filename); |
| 47 | 47 | }); |
| 48 | 48 | return $filename; |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace h4kuna\Fio\Response\Read; |
| 4 | 4 | |
| 5 | -use h4kuna\Fio, |
|
| 6 | - h4kuna\Fio\Utils; |
|
| 5 | +use h4kuna\Fio; |
|
| 6 | +use h4kuna\Fio\Utils; |
|
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * @author Milan Matějček |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | public function __construct($transactionClass = null) |
| 27 | 27 | { |
| 28 | 28 | if ($transactionClass === null) { |
| 29 | - $transactionClass = __NAMESPACE__ . '\Transaction'; |
|
| 29 | + $transactionClass = __NAMESPACE__.'\Transaction'; |
|
| 30 | 30 | } |
| 31 | 31 | $this->transactionClass = $transactionClass; |
| 32 | 32 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | { |
| 43 | 43 | $transaction = $this->createTransactionObject($dateFormat); |
| 44 | 44 | foreach (self::metaProperty($transaction) as $id => $meta) { |
| 45 | - $value = isset($data->{'column' . $id}) ? $data->{'column' . $id}->value : null; |
|
| 45 | + $value = isset($data->{'column'.$id}) ? $data->{'column'.$id}->value : null; |
|
| 46 | 46 | $transaction->bindProperty($meta['name'], $meta['type'], $value); |
| 47 | 47 | } |
| 48 | 48 | return $transaction; |
@@ -38,15 +38,15 @@ discard block |
||
| 38 | 38 | return $data; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * @param $data |
|
| 43 | - * @param $dateFormat |
|
| 44 | - * @return TransactionAbstract|null|string |
|
| 45 | - * @throws Fio\InvalidArgumentException |
|
| 46 | - * @throws Fio\TransactionExtendException |
|
| 47 | - * @throws Fio\TransactionPropertyException |
|
| 48 | - */ |
|
| 49 | - public function createTransaction($data, $dateFormat) |
|
| 41 | + /** |
|
| 42 | + * @param $data |
|
| 43 | + * @param $dateFormat |
|
| 44 | + * @return TransactionAbstract|null|string |
|
| 45 | + * @throws Fio\InvalidArgumentException |
|
| 46 | + * @throws Fio\TransactionExtendException |
|
| 47 | + * @throws Fio\TransactionPropertyException |
|
| 48 | + */ |
|
| 49 | + public function createTransaction($data, $dateFormat) |
|
| 50 | 50 | { |
| 51 | 51 | $transaction = $this->createTransactionObject($dateFormat); |
| 52 | 52 | foreach (self::metaProperty($transaction) as $id => $meta) { |
@@ -62,13 +62,13 @@ discard block |
||
| 62 | 62 | return new TransactionList($info); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - /** |
|
| 66 | - * @param $dateFormat |
|
| 67 | - * @return TransactionAbstract|null|string |
|
| 68 | - * @throws Fio\InvalidArgumentException |
|
| 69 | - * @throws Fio\TransactionExtendException |
|
| 70 | - */ |
|
| 71 | - protected function createTransactionObject($dateFormat) |
|
| 65 | + /** |
|
| 66 | + * @param $dateFormat |
|
| 67 | + * @return TransactionAbstract|null|string |
|
| 68 | + * @throws Fio\InvalidArgumentException |
|
| 69 | + * @throws Fio\TransactionExtendException |
|
| 70 | + */ |
|
| 71 | + protected function createTransactionObject($dateFormat) |
|
| 72 | 72 | { |
| 73 | 73 | if ($this->transactionClassCheck === false) { |
| 74 | 74 | if (is_string($this->transactionClass)) { |
@@ -87,12 +87,12 @@ discard block |
||
| 87 | 87 | return clone $this->transactionClass; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - /** |
|
| 91 | - * @param $class |
|
| 92 | - * @return array|string[] |
|
| 93 | - * @throws Fio\TransactionPropertyException |
|
| 94 | - */ |
|
| 95 | - private static function metaProperty($class) |
|
| 90 | + /** |
|
| 91 | + * @param $class |
|
| 92 | + * @return array|string[] |
|
| 93 | + * @throws Fio\TransactionPropertyException |
|
| 94 | + */ |
|
| 95 | + private static function metaProperty($class) |
|
| 96 | 96 | { |
| 97 | 97 | if (self::$property !== null) { |
| 98 | 98 | return self::$property; |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace h4kuna\Fio\Utils; |
| 4 | 4 | |
| 5 | -use h4kuna\Fio\Account, |
|
| 6 | - Nette\Utils\DateTime; |
|
| 5 | +use h4kuna\Fio\Account; |
|
| 6 | +use Nette\Utils\DateTime; |
|
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * @author Milan Matějček |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | if ($bankCode) { |
| 34 | 34 | $account .= '/'; |
| 35 | 35 | } |
| 36 | - return new Account\Bank($account . $bankCode); |
|
| 36 | + return new Account\Bank($account.$bankCode); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -23,12 +23,12 @@ |
||
| 23 | 23 | return $str ? mb_substr($str, 0, $limit) : null; // max length from API |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * @param string $account |
|
| 28 | - * @param string|NULL $bankCode |
|
| 29 | - * @return Account\Bank |
|
| 30 | - * @throws \h4kuna\Fio\AccountException |
|
| 31 | - */ |
|
| 26 | + /** |
|
| 27 | + * @param string $account |
|
| 28 | + * @param string|NULL $bankCode |
|
| 29 | + * @return Account\Bank |
|
| 30 | + * @throws \h4kuna\Fio\AccountException |
|
| 31 | + */ |
|
| 32 | 32 | public static function createAccount($account, $bankCode = null) |
| 33 | 33 | { |
| 34 | 34 | if ($bankCode) { |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | if (isset($this->accounts[$alias])) { |
| 25 | 25 | return $this->accounts[$alias]; |
| 26 | 26 | } |
| 27 | - throw new AccountException('This account alias does not exists: ' . $alias); |
|
| 27 | + throw new AccountException('This account alias does not exists: '.$alias); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /** @return FioAccount|FALSE */ |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | public function addAccount($alias, FioAccount $account) |
| 42 | 42 | { |
| 43 | 43 | if (isset($this->accounts[$alias])) { |
| 44 | - throw new AccountException('This alias already exists: ' . $alias); |
|
| 44 | + throw new AccountException('This alias already exists: '.$alias); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | $this->accounts[$alias] = $account; |
@@ -33,12 +33,12 @@ |
||
| 33 | 33 | return reset($this->accounts); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * @param string $alias |
|
| 38 | - * @param FioAccount $account |
|
| 39 | - * @return self |
|
| 40 | - * @throws \h4kuna\Fio\AccountException |
|
| 41 | - */ |
|
| 36 | + /** |
|
| 37 | + * @param string $alias |
|
| 38 | + * @param FioAccount $account |
|
| 39 | + * @return self |
|
| 40 | + * @throws \h4kuna\Fio\AccountException |
|
| 41 | + */ |
|
| 42 | 42 | public function addAccount($alias, FioAccount $account) |
| 43 | 43 | { |
| 44 | 44 | if (isset($this->accounts[$alias])) { |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | /** @return string */ |
| 51 | 51 | public function getAccount() |
| 52 | 52 | { |
| 53 | - return $this->prefix . $this->account; |
|
| 53 | + return $this->prefix.$this->account; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** @return string */ |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | public function getAccountAndCode() |
| 75 | 75 | { |
| 76 | - return $this->getAccount() . $this->bankCode; |
|
| 76 | + return $this->getAccount().$this->bankCode; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | public function __toString() |