@@ -20,19 +20,19 @@ discard block |
||
20 | 20 | return ''; |
21 | 21 | } |
22 | 22 | $url = ''; |
23 | - $url .= isset($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : ''; |
|
23 | + $url .= isset($parsed_url['scheme']) ? $parsed_url['scheme'].'://' : ''; |
|
24 | 24 | $url .= isset($parsed_url['host']) ? $parsed_url['host'] : ''; |
25 | - $url .= isset($parsed_url['port']) ? ':' . $parsed_url['port'] : ''; |
|
25 | + $url .= isset($parsed_url['port']) ? ':'.$parsed_url['port'] : ''; |
|
26 | 26 | $user = isset($parsed_url['user']) ? $parsed_url['user'] : ''; |
27 | - $pass = isset($parsed_url['pass']) ? ':' . $parsed_url['pass'] : ''; |
|
28 | - $url .= $user . (($user || $pass) ? "$pass@" : ''); |
|
27 | + $pass = isset($parsed_url['pass']) ? ':'.$parsed_url['pass'] : ''; |
|
28 | + $url .= $user.(($user || $pass) ? "$pass@" : ''); |
|
29 | 29 | if (!empty($url)) { |
30 | - $url .= isset($parsed_url['path']) ? '/' . ltrim($parsed_url['path'], '/') : ''; |
|
30 | + $url .= isset($parsed_url['path']) ? '/'.ltrim($parsed_url['path'], '/') : ''; |
|
31 | 31 | } elseif (empty($url)) { |
32 | 32 | $url .= isset($parsed_url['path']) ? $parsed_url['path'] : ''; |
33 | 33 | } |
34 | - $url .= isset($parsed_url['query']) ? '?' . $parsed_url['query'] : ''; |
|
35 | - $url .= isset($parsed_url['fragment']) ? '#' . $parsed_url['fragment'] : ''; |
|
34 | + $url .= isset($parsed_url['query']) ? '?'.$parsed_url['query'] : ''; |
|
35 | + $url .= isset($parsed_url['fragment']) ? '#'.$parsed_url['fragment'] : ''; |
|
36 | 36 | |
37 | 37 | return $url; |
38 | 38 | } |
@@ -79,8 +79,8 @@ discard block |
||
79 | 79 | public static function substituteAttributesInRoute($attributes, $route) |
80 | 80 | { |
81 | 81 | foreach ($attributes as $key => $value) { |
82 | - $route = str_replace('{' . $key . '}', $value, $route); |
|
83 | - $route = str_replace('{' . $key . '?}', $value, $route); |
|
82 | + $route = str_replace('{'.$key.'}', $value, $route); |
|
83 | + $route = str_replace('{'.$key.'?}', $value, $route); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | // delete empty optional arguments that are not in the $attributes array |
@@ -75,8 +75,8 @@ |
||
75 | 75 | $regional = tongue()->speaking('regional', $locale); |
76 | 76 | |
77 | 77 | if ($regional) { |
78 | - setlocale(LC_TIME, $regional . '.UTF-8'); |
|
79 | - setlocale(LC_MONETARY, $regional . '.UTF-8'); |
|
78 | + setlocale(LC_TIME, $regional.'.UTF-8'); |
|
79 | + setlocale(LC_MONETARY, $regional.'.UTF-8'); |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function current($key = null) |
45 | 45 | { |
46 | - if (! $key) { |
|
46 | + if (!$key) { |
|
47 | 47 | return $this->locale->get(); |
48 | 48 | } |
49 | 49 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | //fallback language is the same as the current language |
89 | 89 | if (Config::beautify() && $this->current() === Config::fallbackLocale()) { |
90 | 90 | //didn't found locale means browser is set to exmaple.com |
91 | - if (! $locale) { |
|
91 | + if (!$locale) { |
|
92 | 92 | return false; |
93 | 93 | } |
94 | 94 | //browser is set to en.example.com but should be forced back to example.com |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | */ |
111 | 111 | public function speaks(string $locale) |
112 | 112 | { |
113 | - if (! $this->isSpeaking($locale)) { |
|
113 | + if (!$this->isSpeaking($locale)) { |
|
114 | 114 | //locale does not exist. |
115 | 115 | return dialect()->redirectBackToLatest(); |
116 | 116 | } |
@@ -43,7 +43,9 @@ |
||
43 | 43 | { |
44 | 44 | $result = request()->cookie($this->key); |
45 | 45 | |
46 | - if (is_array($result)) return null; |
|
46 | + if (is_array($result)) { |
|
47 | + return null; |
|
48 | + } |
|
47 | 49 | |
48 | 50 | return $result; |
49 | 51 | } |