Passed
Pull Request — master (#28)
by Raúl
03:10
created
paylater.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     exit;
12 12
 }
13 13
 
14
-define('_PS_PAYLATER_DIR', _PS_MODULE_DIR_. '/paylater');
14
+define('_PS_PAYLATER_DIR', _PS_MODULE_DIR_.'/paylater');
15 15
 
16 16
 require _PS_PAYLATER_DIR.'/vendor/autoload.php';
17 17
 
@@ -202,18 +202,18 @@  discard block
 block discarded – undo
202 202
     public function checkHooks()
203 203
     {
204 204
         try {
205
-            $sql_content = 'select * from ' . _DB_PREFIX_. 'hook_module where 
206
-            id_module = \'' . Module::getModuleIdByName($this->name) . '\' and 
207
-            id_shop = \'' . Shop::getContextShopID() . '\' and 
208
-            id_hook = \'' . Hook::getIdByName('header') . '\'';
205
+            $sql_content = 'select * from '._DB_PREFIX_.'hook_module where 
206
+            id_module = \'' . Module::getModuleIdByName($this->name).'\' and 
207
+            id_shop = \'' . Shop::getContextShopID().'\' and 
208
+            id_hook = \'' . Hook::getIdByName('header').'\'';
209 209
             $hook_exists = Db::getInstance()->ExecuteS($sql_content);
210 210
             if (empty($hook_exists)) {
211
-                $sql_insert = 'insert into ' . _DB_PREFIX_.  'hook_module 
211
+                $sql_insert = 'insert into '._DB_PREFIX_.'hook_module 
212 212
             (id_module, id_shop, id_hook, position)
213 213
             values
214
-            (\''. Module::getModuleIdByName($this->name) . '\',
215
-            \''. Shop::getContextShopID() . '\',
216
-            \''. Hook::getIdByName('header') . '\',
214
+            (\''. Module::getModuleIdByName($this->name).'\',
215
+            \''. Shop::getContextShopID().'\',
216
+            \''. Hook::getIdByName('header').'\',
217 217
             150)';
218 218
                 Db::getInstance()->execute($sql_insert);
219 219
             }
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 
225 225
     public function loadEnvVariables()
226 226
     {
227
-        $sql_content = 'select * from ' . _DB_PREFIX_. 'pmt_config';
227
+        $sql_content = 'select * from '._DB_PREFIX_.'pmt_config';
228 228
         $dbConfigs = Db::getInstance()->executeS($sql_content);
229 229
 
230 230
         // Convert a multimple dimension array for SQL insert statements into a simple key/value
@@ -245,11 +245,11 @@  discard block
 block discarded – undo
245 245
         }
246 246
 
247 247
         foreach (array_merge($this->defaultConfigs, $simpleDbConfigs) as $key => $value) {
248
-            putenv($key . '=' . $value);
248
+            putenv($key.'='.$value);
249 249
         }
250 250
 
251 251
         // Save defaultOptions as a env varible to have it in configController
252
-        putenv("PMT_DEFAULT_CONFIGS" . '=' . json_encode($this->defaultConfigs));
252
+        putenv("PMT_DEFAULT_CONFIGS".'='.json_encode($this->defaultConfigs));
253 253
     }
254 254
 
255 255
     /**
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
         } else {
333 333
             $this->context->controller->addJS('http://cdn.pagamastarde.com/js/pmt-v2/sdk.js');
334 334
         }
335
-        $this->context->controller->addJS($this->getPathUri(). 'views/js/simulator.js');
335
+        $this->context->controller->addJS($this->getPathUri().'views/js/simulator.js');
336 336
     }
337 337
 
338 338
     /**
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
         $paymentOption
382 382
             ->setCallToActionText($pmtTitle)
383 383
             ->setAction($link->getModuleLink('paylater', 'payment'))
384
-            ->setLogo($this->getPathUri(). 'logo.gif')
384
+            ->setLogo($this->getPathUri().'logo.gif')
385 385
             ->setModuleName(__CLASS__)
386 386
         ;
387 387
 
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
                 'input' => array(
412 412
                     array(
413 413
                         'name' => 'pmt_is_enabled',
414
-                        'type' =>  (version_compare(_PS_VERSION_, '1.6')<0) ?'radio' :'switch',
414
+                        'type' =>  (version_compare(_PS_VERSION_, '1.6') < 0) ? 'radio' : 'switch',
415 415
                         'label' => $this->l('Module is enabled'),
416 416
                         'prefix' => '<i class="icon icon-key"></i>',
417 417
                         'class' => 't',
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
                     ),
452 452
                     array(
453 453
                         'name' => 'pmt_simulator_is_enabled',
454
-                        'type' => (version_compare(_PS_VERSION_, '1.6')<0) ?'radio' :'switch',
454
+                        'type' => (version_compare(_PS_VERSION_, '1.6') < 0) ? 'radio' : 'switch',
455 455
                         'label' => $this->l('Simulator is enabled'),
456 456
                         'prefix' => '<i class="icon icon-key"></i>',
457 457
                         'class' => 't',
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
             $message = $this->displayError($this->dotEnvError);
571 571
         }
572 572
 
573
-        $logo = $this->getPathUri(). 'views/img/logo_pagamastarde.png';
573
+        $logo = $this->getPathUri().'views/img/logo_pagamastarde.png';
574 574
         $tpl = $this->local_path.'views/templates/admin/config-info.tpl';
575 575
         $this->context->smarty->assign(array(
576 576
             'logo' => $logo,
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
         /** @var ProductCore $product */
656 656
         $product = new Product(Tools::getValue('id_product'));
657 657
         $amount = $product->getPublicPrice();
658
-        $pmtPublicKey                = Configuration::get('pmt_public_key');
658
+        $pmtPublicKey = Configuration::get('pmt_public_key');
659 659
         $pmtSimulatorIsEnabled        = Configuration::get('pmt_simulator_is_enabled');
660 660
         $pmtIsEnabled                 = Configuration::get('pmt_is_enabled');
661 661
         $pmtSimulatorType             = getenv('PMT_SIMULATOR_DISPLAY_TYPE');
@@ -764,10 +764,10 @@  discard block
 block discarded – undo
764 764
      */
765 765
     public function checkLogoExists()
766 766
     {
767
-        $logo = _PS_MODULE_DIR_ . '/onepagecheckoutps/views/img/payments/'. Tools::strtolower(__CLASS__). '.png';
768
-        if (!file_exists($logo) && is_dir(_PS_MODULE_DIR_ . '/onepagecheckoutps/views/img/payments')) {
767
+        $logo = _PS_MODULE_DIR_.'/onepagecheckoutps/views/img/payments/'.Tools::strtolower(__CLASS__).'.png';
768
+        if (!file_exists($logo) && is_dir(_PS_MODULE_DIR_.'/onepagecheckoutps/views/img/payments')) {
769 769
             copy(
770
-                _PS_PAYLATER_DIR . '/views/img/logo-64x64.png',
770
+                _PS_PAYLATER_DIR.'/views/img/logo-64x64.png',
771 771
                 $logo
772 772
             );
773 773
         }
Please login to merge, or discard this patch.
controllers/front/config.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,11 +18,11 @@  discard block
 block discarded – undo
18 18
     public function initContent()
19 19
     {
20 20
         $this->authorize();
21
-        $method = strtolower($_SERVER['REQUEST_METHOD']) . "Method";
21
+        $method = strtolower($_SERVER['REQUEST_METHOD'])."Method";
22 22
         if (method_exists($this, $method)) {
23 23
             header('HTTP/1.1 200 Ok', true, 200);
24 24
             header('Content-Type: application/json', true);
25
-            header('Content-Length: ' . Tools::strlen($result));
25
+            header('Content-Length: '.Tools::strlen($result));
26 26
             echo json_encode($this->{$method}());
27 27
             exit();
28 28
         }
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
                     Db::getInstance()->update(
46 46
                         'pmt_config',
47 47
                         array('value' => $value),
48
-                        'config = \''. $config .'\''
48
+                        'config = \''.$config.'\''
49 49
                     );
50 50
                 } else {
51 51
                     $errors[$config] = $value;
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public function getMethod()
71 71
     {
72
-        $sql_content = 'select * from ' . _DB_PREFIX_. 'pmt_config';
72
+        $sql_content = 'select * from '._DB_PREFIX_.'pmt_config';
73 73
         $dbConfigs = Db::getInstance()->executeS($sql_content);
74 74
 
75 75
         // Convert a multimple dimension array for SQL insert statements into a simple key/value
Please login to merge, or discard this patch.