@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace ByTIC\Common\Controllers\Traits; |
| 4 | 4 | |
| 5 | 5 | use ByTIC\Common\Controllers\Traits\Models\HasModelLister; |
| 6 | -use Nip\Database\Query\Select as SelectQuery; |
|
| 7 | 6 | use Nip\Records\Record; |
| 8 | 7 | use Nip\Request; |
| 9 | 8 | use Nip\View; |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use ByTIC\Common\Payments\Gateways\Providers\AbstractGateway\Message\PurchaseRequest; |
| 6 | 6 | use ByTIC\Common\Payments\Gateways\Providers\AbstractGateway\Message\RedirectResponse\RedirectTrait; |
| 7 | -use ByTIC\Common\Payments\Models\BillingRecord\Traits\RecordTrait as BillingRecord; |
|
| 8 | 7 | use ByTIC\Common\Payments\Models\BillingRecord\Traits\RecordTrait as BillingRecordTrait; |
| 9 | 8 | use ByTIC\Common\Payments\Models\Methods\Traits\RecordTrait; |
| 10 | 9 | use ByTIC\Common\Records\Records; |
@@ -97,7 +97,7 @@ |
||
| 97 | 97 | */ |
| 98 | 98 | public function getConfirmStatusTitle() |
| 99 | 99 | { |
| 100 | - return $this->getManager()->getMessage('confirm.'.$this->getStatus()->getName()); |
|
| 100 | + return $this->getManager()->getMessage('confirm.' . $this->getStatus()->getName()); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $this->changeSmartPropertyRedirect($name, $item); |
| 59 | 59 | } else { |
| 60 | 60 | $redirect = $_SERVER['HTTP_REFERER']; |
| 61 | - $this->flashRedirect($this->getModelManager()->getMessage(inflector()->pluralize($name).'.invalid-value'), |
|
| 61 | + $this->flashRedirect($this->getModelManager()->getMessage(inflector()->pluralize($name) . '.invalid-value'), |
|
| 62 | 62 | $redirect, 'error'); |
| 63 | 63 | } |
| 64 | 64 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | public function changeSmartPropertyRedirect($name, $item) |
| 71 | 71 | { |
| 72 | 72 | $redirect = $_SERVER['HTTP_REFERER'] ? $_SERVER['HTTP_REFERER'] : $item->getURL(); |
| 73 | - $this->flashRedirect($this->getModelManager()->getMessage(inflector()->pluralize($name).'.success'), $redirect); |
|
| 73 | + $this->flashRedirect($this->getModelManager()->getMessage(inflector()->pluralize($name) . '.success'), $redirect); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * @param ImgPicker $instance |
| 49 | 49 | * @return string|array |
| 50 | 50 | */ |
| 51 | - 'load' => function ($instance) { |
|
| 51 | + 'load' => function($instance) { |
|
| 52 | 52 | //return 'avatar.jpg'; |
| 53 | 53 | }, |
| 54 | 54 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | * @param ImgPicker $instance |
| 60 | 60 | * @return boolean |
| 61 | 61 | */ |
| 62 | - 'delete' => function ($filename, $instance) { |
|
| 62 | + 'delete' => function($filename, $instance) { |
|
| 63 | 63 | return true; |
| 64 | 64 | }, |
| 65 | 65 | |
@@ -70,8 +70,8 @@ discard block |
||
| 70 | 70 | * @param ImgPicker $instance |
| 71 | 71 | * @return void |
| 72 | 72 | */ |
| 73 | - 'upload_start' => function ($image, $instance) { |
|
| 74 | - $image->name = '~toCropFP'.$item->ID.'-'.rand(1000, 4000).'.'.$image->type; |
|
| 73 | + 'upload_start' => function($image, $instance) { |
|
| 74 | + $image->name = '~toCropFP' . $item->ID . '-' . rand(1000, 4000) . '.' . $image->type; |
|
| 75 | 75 | }, |
| 76 | 76 | |
| 77 | 77 | /** |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | * @param ImgPicker $instance |
| 82 | 82 | * @return void |
| 83 | 83 | */ |
| 84 | - 'upload_complete' => function ($image, $instance) { |
|
| 84 | + 'upload_complete' => function($image, $instance) { |
|
| 85 | 85 | }, |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -91,8 +91,8 @@ discard block |
||
| 91 | 91 | * @param ImgPicker $instance |
| 92 | 92 | * @return void |
| 93 | 93 | */ |
| 94 | - 'crop_start' => function ($image, $instance) { |
|
| 95 | - $image->name = sha1(microtime()).'.'.$image->type; |
|
| 94 | + 'crop_start' => function($image, $instance) { |
|
| 95 | + $image->name = sha1(microtime()) . '.' . $image->type; |
|
| 96 | 96 | }, |
| 97 | 97 | |
| 98 | 98 | /** |
@@ -102,11 +102,11 @@ discard block |
||
| 102 | 102 | * @param ImgPicker $instance |
| 103 | 103 | * @return void |
| 104 | 104 | */ |
| 105 | - 'crop_complete' => function ($image, $instance) { |
|
| 105 | + 'crop_complete' => function($image, $instance) { |
|
| 106 | 106 | foreach (['full', 'default'] as $version) { |
| 107 | 107 | $filename = $instance->getVersionFilename($image->name, $version); |
| 108 | 108 | $filepath = $instance->getUploadPath($filename, $version); |
| 109 | - rename($filepath, str_replace('-'.$version.'.', '.', $filepath)); |
|
| 109 | + rename($filepath, str_replace('-' . $version . '.', '.', $filepath)); |
|
| 110 | 110 | } |
| 111 | 111 | }, |
| 112 | 112 | ]; |
@@ -129,8 +129,8 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if (intval($_SERVER['CONTENT_LENGTH']) > 0 && count($_POST) === 0) { |
| 132 | - $maxSize = round(($this->getRequest()->server->getMaxFileSize() / 1048576), 2).'MB'; |
|
| 133 | - $this->response['error'] = 'File to big. Max size ['.$maxSize.']'; |
|
| 132 | + $maxSize = round(($this->getRequest()->server->getMaxFileSize() / 1048576), 2) . 'MB'; |
|
| 133 | + $this->response['error'] = 'File to big. Max size [' . $maxSize . ']'; |
|
| 134 | 134 | |
| 135 | 135 | return $this->_output(); |
| 136 | 136 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | protected function initItems() |
| 49 | 49 | { |
| 50 | 50 | $this->items = []; |
| 51 | - $iterator = new DirectoryIterator(dirname(__FILE__).'/Providers'); |
|
| 51 | + $iterator = new DirectoryIterator(dirname(__FILE__) . '/Providers'); |
|
| 52 | 52 | foreach ($iterator as $fileinfo) { |
| 53 | 53 | if ($fileinfo->isDir()) { |
| 54 | 54 | $name = $fileinfo->getFilename(); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public function newItem($name = false) |
| 68 | 68 | { |
| 69 | - $className = 'ByTIC\Common\Payments\Gateways\Providers\\'.$name.'\Gateway'; |
|
| 69 | + $className = 'ByTIC\Common\Payments\Gateways\Providers\\' . $name . '\Gateway'; |
|
| 70 | 70 | /** @var Gateway $object */ |
| 71 | 71 | $object = new $className(); |
| 72 | 72 | $object->setManager($this); |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | public function getLabel($type, $params = [], $language = false) |
| 146 | 146 | { |
| 147 | - return translator()->translate('payment-gateways.labels.'.$type, $params, $language); |
|
| 147 | + return translator()->translate('payment-gateways.labels.' . $type, $params, $language); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | /** |
@@ -155,6 +155,6 @@ discard block |
||
| 155 | 155 | */ |
| 156 | 156 | public function getMessage($name, $params = [], $language = false) |
| 157 | 157 | { |
| 158 | - return translator()->translate('payment-gateways.messages.'.$name, $params, $language); |
|
| 158 | + return translator()->translate('payment-gateways.messages.' . $name, $params, $language); |
|
| 159 | 159 | } |
| 160 | 160 | } |
@@ -13,13 +13,13 @@ |
||
| 13 | 13 | public function initElements() |
| 14 | 14 | { |
| 15 | 15 | $this->addRadioGroup('sandbox', 'sandbox', true); |
| 16 | - $element = $this->getForm()->getElement($this->getGateway()->getName().'[sandbox]'); |
|
| 16 | + $element = $this->getForm()->getElement($this->getGateway()->getName() . '[sandbox]'); |
|
| 17 | 17 | $element->getRenderer()->setSeparator(''); |
| 18 | 18 | $element->addOption('yes', 'Yes'); |
| 19 | 19 | $element->addOption('no', 'No'); |
| 20 | 20 | |
| 21 | 21 | $this->addSelect('paymentpage', 'Payment Page', true); |
| 22 | - $element = $this->getForm()->getElement($this->getGateway()->getName().'[paymentpage]'); |
|
| 22 | + $element = $this->getForm()->getElement($this->getGateway()->getName() . '[paymentpage]'); |
|
| 23 | 23 | $element->addOption('paylogin', 'Pay login'); |
| 24 | 24 | $element->addOption('credit_paydirect', 'Pay direct'); |
| 25 | 25 | |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | public function getContent() |
| 38 | 38 | { |
| 39 | - return '<EPAYMENT>'.$this->data['dateReturn'].'|'.$this->data['hashReturn'].'</EPAYMENT>'; |
|
| 39 | + return '<EPAYMENT>' . $this->data['dateReturn'] . '|' . $this->data['hashReturn'] . '</EPAYMENT>'; |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** @noinspection PhpMissingParentCallCommonInspection |
@@ -1338,7 +1338,7 @@ discard block |
||
| 1338 | 1338 | if ($isArray) { |
| 1339 | 1339 | for ($i = 0; $i < count($fieldValue); $i++) { |
| 1340 | 1340 | $fieldValue[$i] = htmlspecialchars($fieldValue[$i]); |
| 1341 | - $retval .= "<input name=\"".$fieldName."[]\" type=\"hidden\" value=\"".$fieldValue[$i]."\" id=\"$fieldName\">\n"; |
|
| 1341 | + $retval .= "<input name=\"" . $fieldName . "[]\" type=\"hidden\" value=\"" . $fieldValue[$i] . "\" id=\"$fieldName\">\n"; |
|
| 1342 | 1342 | //$retval .= "<input name=\"".$fieldName."[]\" type=\"text\" value=\"".$fieldValue[$i]."\" id=\"$fieldName\">\n"; |
| 1343 | 1343 | } |
| 1344 | 1344 | } else { |
@@ -1373,7 +1373,7 @@ discard block |
||
| 1373 | 1373 | $k_ipad = $key ^ $ipad; |
| 1374 | 1374 | $k_opad = $key ^ $opad; |
| 1375 | 1375 | |
| 1376 | - return md5($k_opad.pack("H*", md5($k_ipad.$data))); |
|
| 1376 | + return md5($k_opad . pack("H*", md5($k_ipad . $data))); |
|
| 1377 | 1377 | } |
| 1378 | 1378 | |
| 1379 | 1379 | /** |
@@ -1450,7 +1450,7 @@ discard block |
||
| 1450 | 1450 | $retval = ""; |
| 1451 | 1451 | //$string = htmlspecialchars($string); |
| 1452 | 1452 | $size = strlen($string); |
| 1453 | - $retval = $size.$string; |
|
| 1453 | + $retval = $size . $string; |
|
| 1454 | 1454 | |
| 1455 | 1455 | return $retval; |
| 1456 | 1456 | } |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | protected function initView() |
| 61 | 61 | { |
| 62 | 62 | $view = $this->newView(); |
| 63 | - $view->setBasePath(dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'Views'.DIRECTORY_SEPARATOR); |
|
| 63 | + $view->setBasePath(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'Views' . DIRECTORY_SEPARATOR); |
|
| 64 | 64 | $this->setView($view); |
| 65 | 65 | } |
| 66 | 66 | |