Completed
Push — master ( efb352...721e90 )
by Nicolaas
02:47
created
code/model/address/CountryPrice_EcommerceCountry.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
                     'Root.FAQPage',
89 89
                     new LiteralField(
90 90
                         "FAQPageExplanation",
91
-                        "<p class=\"message warning\">FAQ information can only be added to the main country for a ". _t('Distributor.SINGULAR_NAME', 'Distributor') ."</p>"
91
+                        "<p class=\"message warning\">FAQ information can only be added to the main country for a "._t('Distributor.SINGULAR_NAME', 'Distributor')."</p>"
92 92
                     )
93 93
                 );
94 94
             }
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
             $originalCountry = $country;
211 211
 
212 212
             //no country provided
213
-            if (! $country) {
213
+            if (!$country) {
214 214
                 $urlCountryCode = CountryPrice_Translation::get_country_url_provider()->CurrentCountrySegment();
215 215
 
216 216
                 // 2. CHECK WHAT THE SYSTEM THINKS THE COUNTRY CHOULD BE
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
                 }
226 226
 
227 227
                 //if we still dont have a country then we use the standard e-commerce methods ...
228
-                if (! $countryCode) {
228
+                if (!$countryCode) {
229 229
                     $countryCode = EcommerceCountry::get_country();
230 230
                 }
231 231
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
                     if (
245 245
                             ($country && $country->Code !== $urlCountryCode)
246 246
                         ||
247
-                            ! $country
247
+                            !$country
248 248
 
249 249
                     ) {
250 250
                         $country = DataObject::get_one('EcommerceCountry', ['Code' => $urlCountryCode]);
@@ -314,9 +314,9 @@  discard block
 block discarded – undo
314 314
     public static function get_backup_country()
315 315
     {
316 316
         $obj = EcommerceCountry::get()->filter(array("IsBackupCountry" => true))->first();
317
-        if (! $obj) {
317
+        if (!$obj) {
318 318
             $obj = EcommerceCountry::get()->filter(array("Code" => EcommerceConfig::get('EcommerceCountry', 'default_country_code')))->first();
319
-            if (! $obj) {
319
+            if (!$obj) {
320 320
                 $obj = EcommerceCountry::get()->first();
321 321
             }
322 322
         }
Please login to merge, or discard this patch.
code/control/CountryPrice_ChangeCountryController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
         //redirect now
87 87
         if (isset($_GET['force']) && $_GET['force']) {
88
-            return $this->redirect($this->Link($newCountryCode) . '?force-back-home');
88
+            return $this->redirect($this->Link($newCountryCode).'?force-back-home');
89 89
         }
90 90
         if (isset($_GET['force-back-home']) && $_GET['force-back-home']) {
91 91
             return $this->redirect(Director::baseURL('/'));
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             $action
107 107
         );
108 108
 
109
-        return $link . '/';
109
+        return $link.'/';
110 110
     }
111 111
 
112 112
     /**
@@ -160,10 +160,10 @@  discard block
 block discarded – undo
160 160
 
161 161
             $path = isset($parsedUrl['path']) ? $parsedUrl['path'] : '';
162 162
 
163
-            $query = empty($query) ? '' :  '?'. http_build_query($query);
163
+            $query = empty($query) ? '' : '?'.http_build_query($query);
164 164
             $newURL =
165
-                $parsedUrl['scheme'] .
166
-                '://' .
165
+                $parsedUrl['scheme'].
166
+                '://'.
167 167
                 Controller::join_links(
168 168
                     $parsedUrl['host'],
169 169
                     $parsedUrl['path']
Please login to merge, or discard this patch.
code/api/CountryURLProvider.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         $potentialCountry = '';
41 41
         if ($includeGetVariable)
42 42
             $getVar = Config::inst()->get('CountryURLProvider', 'locale_get_parameter');
43
-            if(isset($_GET[$getVar])) {
43
+            if (isset($_GET[$getVar])) {
44 44
                 $potentialCountry = $_GET[$getVar];
45 45
             }
46 46
         }
@@ -92,14 +92,14 @@  discard block
 block discarded – undo
92 92
             }
93 93
             $parsedUrl['path'] = implode('/', $pathParts);
94 94
             $newURL =
95
-                $parsedUrl['scheme'] .
96
-                '://' .
95
+                $parsedUrl['scheme'].
96
+                '://'.
97 97
                 Controller::join_links(
98 98
                     $parsedUrl['host'],
99 99
                     $parsedUrl['path']
100 100
                 );
101 101
             if (isset($parsedUrl['query'])) {
102
-                $newURL = $newURL . '?' . $parsedUrl['query'];
102
+                $newURL = $newURL.'?'.$parsedUrl['query'];
103 103
             }
104 104
         }
105 105
         if (trim($oldURL, '/') !== trim($newURL, '/')) {
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,8 +38,9 @@
 block discarded – undo
38 38
     public function CurrentCountrySegment($url = '', $includeGetVariable = true)
39 39
     {
40 40
         $potentialCountry = '';
41
-        if ($includeGetVariable)
42
-            $getVar = Config::inst()->get('CountryURLProvider', 'locale_get_parameter');
41
+        if ($includeGetVariable) {
42
+                    $getVar = Config::inst()->get('CountryURLProvider', 'locale_get_parameter');
43
+        }
43 44
             if(isset($_GET[$getVar])) {
44 45
                 $potentialCountry = $_GET[$getVar];
45 46
             }
Please login to merge, or discard this patch.