Completed
Push — master ( 3836b1...3ec6e2 )
by Raúl
16s queued 16s
created
pagantis.php 1 patch
Spacing   +22 added lines, -22 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_PAGANTIS_DIR', _PS_MODULE_DIR_. '/pagantis');
14
+define('_PS_PAGANTIS_DIR', _PS_MODULE_DIR_.'/pagantis');
15 15
 define('PROMOTIONS_CATEGORY', 'pagantis-promotion-product');
16 16
 define('PROMOTIONS_CATEGORY_NAME', 'Pagantis Promoted Product');
17 17
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
         Configuration::updateValue('pagantis_public_key', '');
139 139
         Configuration::updateValue('pagantis_private_key', '');
140 140
 
141
-        $return =  (parent::install()
141
+        $return = (parent::install()
142 142
             && $this->registerHook('displayShoppingCart')
143 143
             && $this->registerHook('paymentOptions')
144 144
             && $this->registerHook('displayRightColumn')
@@ -220,18 +220,18 @@  discard block
 block discarded – undo
220 220
     public function checkHooks()
221 221
     {
222 222
         try {
223
-            $sql_content = 'select * from ' . _DB_PREFIX_. 'hook_module where 
224
-            id_module = \'' . Module::getModuleIdByName($this->name) . '\' and 
225
-            id_shop = \'' . Shop::getContextShopID() . '\' and 
226
-            id_hook = \'' . Hook::getIdByName('header') . '\'';
223
+            $sql_content = 'select * from '._DB_PREFIX_.'hook_module where 
224
+            id_module = \'' . Module::getModuleIdByName($this->name).'\' and 
225
+            id_shop = \'' . Shop::getContextShopID().'\' and 
226
+            id_hook = \'' . Hook::getIdByName('header').'\'';
227 227
             $hook_exists = Db::getInstance()->ExecuteS($sql_content);
228 228
             if (empty($hook_exists)) {
229
-                $sql_insert = 'insert into ' . _DB_PREFIX_.  'hook_module 
229
+                $sql_insert = 'insert into '._DB_PREFIX_.'hook_module 
230 230
             (id_module, id_shop, id_hook, position)
231 231
             values
232
-            (\''. Module::getModuleIdByName($this->name) . '\',
233
-            \''. Shop::getContextShopID() . '\',
234
-            \''. Hook::getIdByName('header') . '\',
232
+            (\''. Module::getModuleIdByName($this->name).'\',
233
+            \''. Shop::getContextShopID().'\',
234
+            \''. Hook::getIdByName('header').'\',
235 235
             150)';
236 236
                 Db::getInstance()->execute($sql_insert);
237 237
             }
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
      */
246 246
     public function checkEnvVariables()
247 247
     {
248
-        $sql_content = 'select * from ' . _DB_PREFIX_. 'pagantis_config';
248
+        $sql_content = 'select * from '._DB_PREFIX_.'pagantis_config';
249 249
         $dbConfigs = Db::getInstance()->executeS($sql_content);
250 250
 
251 251
         // Convert a multimple dimension array for SQL insert statements into a simple key/value
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
                 'input' => array(
466 466
                     array(
467 467
                         'name' => 'pagantis_is_enabled',
468
-                        'type' =>  (version_compare(_PS_VERSION_, '1.6')<0) ?'radio' :'switch',
468
+                        'type' =>  (version_compare(_PS_VERSION_, '1.6') < 0) ? 'radio' : 'switch',
469 469
                         'label' => $this->l('Module is enabled'),
470 470
                         'prefix' => '<i class="icon icon-key"></i>',
471 471
                         'class' => 't',
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
                     ),
506 506
                     array(
507 507
                         'name' => 'pagantis_simulator_is_enabled',
508
-                        'type' => (version_compare(_PS_VERSION_, '1.6')<0) ?'radio' :'switch',
508
+                        'type' => (version_compare(_PS_VERSION_, '1.6') < 0) ? 'radio' : 'switch',
509 509
                         'label' => $this->l('Simulator is enabled'),
510 510
                         'prefix' => '<i class="icon icon-key"></i>',
511 511
                         'class' => 't',
@@ -866,16 +866,16 @@  discard block
 block discarded – undo
866 866
         if (!in_array(PROMOTIONS_CATEGORY_NAME, $categories)) {
867 867
             /** @var CategoryCore $category */
868 868
             $category = new Category();
869
-            $categoryArray = array((int)Configuration::get('PS_LANG_DEFAULT')=> PROMOTIONS_CATEGORY );
869
+            $categoryArray = array((int) Configuration::get('PS_LANG_DEFAULT')=> PROMOTIONS_CATEGORY);
870 870
             $category->is_root_category = false;
871 871
             $category->link_rewrite = $categoryArray;
872 872
             $category->meta_description = $categoryArray;
873 873
             $category->meta_keywords = $categoryArray;
874 874
             $category->meta_title = $categoryArray;
875
-            $category->name = array((int)Configuration::get('PS_LANG_DEFAULT')=> PROMOTIONS_CATEGORY_NAME);
875
+            $category->name = array((int) Configuration::get('PS_LANG_DEFAULT')=> PROMOTIONS_CATEGORY_NAME);
876 876
             $category->id_parent = Configuration::get('PS_HOME_CATEGORY');
877
-            $category->active=0;
878
-            $description = 'Pagantis: Products with this category have free financing assumed by the merchant. ' .
877
+            $category->active = 0;
878
+            $description = 'Pagantis: Products with this category have free financing assumed by the merchant. '.
879 879
                 'Use it to promote your products or brands.';
880 880
             $category->description = $this->l($description);
881 881
             $category->save();
@@ -889,7 +889,7 @@  discard block
 block discarded – undo
889 889
             return '';
890 890
         }
891 891
 
892
-        $sql = 'SELECT value FROM '._DB_PREFIX_.'pagantis_config where config = \'' . pSQL($config) . '\' limit 1';
892
+        $sql = 'SELECT value FROM '._DB_PREFIX_.'pagantis_config where config = \''.pSQL($config).'\' limit 1';
893 893
         if ($results = Db::getInstance()->ExecuteS($sql)) {
894 894
             if (is_array($results) && count($results) === 1 && isset($results[0]['value'])) {
895 895
                 return $results[0]['value'];
@@ -904,10 +904,10 @@  discard block
 block discarded – undo
904 904
      */
905 905
     public function checkLogoExists()
906 906
     {
907
-        $logoPg = _PS_MODULE_DIR_ . '/onepagecheckoutps/views/img/payments/pagantis.png';
908
-        if (!file_exists($logoPg) && is_dir(_PS_MODULE_DIR_ . '/onepagecheckoutps/views/img/payments')) {
907
+        $logoPg = _PS_MODULE_DIR_.'/onepagecheckoutps/views/img/payments/pagantis.png';
908
+        if (!file_exists($logoPg) && is_dir(_PS_MODULE_DIR_.'/onepagecheckoutps/views/img/payments')) {
909 909
             copy(
910
-                _PS_PAGANTIS_DIR . '/logo.png',
910
+                _PS_PAGANTIS_DIR.'/logo.png',
911 911
                 $logoPg
912 912
             );
913 913
         }
@@ -923,7 +923,7 @@  discard block
 block discarded – undo
923 923
         if (count($langArray) != 2 && isset($lang['locale'])) {
924 924
             $langArray = explode("-", $lang['locale']);
925 925
         }
926
-        $this->language = Tools::strtoupper($langArray[count($langArray)-1]);
926
+        $this->language = Tools::strtoupper($langArray[count($langArray) - 1]);
927 927
         // Prevent null language detection
928 928
         if (in_array(Tools::strtolower($this->language), $this->allowedCountries)) {
929 929
             return;
Please login to merge, or discard this patch.