Passed
Pull Request — master (#2)
by Philipp
01:54
created
src/Localization/Localization.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
     {
20 20
         $locale = self::fromUrl();
21 21
 
22
-        if (! $locale) {
23
-            if (! Config::beautify()) {
22
+        if (!$locale) {
23
+            if (!Config::beautify()) {
24 24
                 return Config::fallbackLocale(); //redirects see test it_ignoes_cookies_and_redirects....
25 25
             }
26 26
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      */
86 86
     protected static function languageIsSet()
87 87
     {
88
-        return ! app()->runningInConsole() || array_has(request()->server(), 'HTTP_ACCEPT_LANGUAGE');
88
+        return !app()->runningInConsole() || array_has(request()->server(), 'HTTP_ACCEPT_LANGUAGE');
89 89
     }
90 90
 
91 91
     /**
Please login to merge, or discard this patch.
src/Localization/TongueDetector.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $matches = $this->getMatchesFromAcceptedLanguages();
65 65
 
66 66
         foreach ($matches as $key => $q) {
67
-            if (! empty($this->supportedLanguages[$key])) {
67
+            if (!empty($this->supportedLanguages[$key])) {
68 68
                 return $key;
69 69
             }
70 70
 
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
             return key($this->supportedLanguages);
88 88
         }
89 89
 
90
-        if ($this->use_intl && ! empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
90
+        if ($this->use_intl && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
91 91
             $http_accept_language = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);
92 92
 
93
-            if (! empty($this->supportedLanguages[$http_accept_language])) {
93
+            if (!empty($this->supportedLanguages[$http_accept_language])) {
94 94
                 return $http_accept_language;
95 95
             }
96 96
         }
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
             $remote_host = explode('.', $this->request->server('REMOTE_HOST'));
100 100
             $lang = strtolower(end($remote_host));
101 101
 
102
-            if (! empty($this->supportedLanguages[$lang])) {
102
+            if (!empty($this->supportedLanguages[$lang])) {
103 103
                 return $lang;
104 104
             }
105 105
         }
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
                 //less than it's parent.
144 144
                 $l_ops = explode('-', $l);
145 145
                 array_pop($l_ops);
146
-                while (! empty($l_ops)) {
146
+                while (!empty($l_ops)) {
147 147
                     //The new generic option needs to be slightly less important than it's base
148 148
                     $q -= 0.001;
149 149
                     $op = implode('-', $l_ops);
Please login to merge, or discard this patch.
src/Accent/Accent.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
         $user = isset($parsed_url['user']) ? $parsed_url['user'] : '';
26 26
         $pass = isset($parsed_url['pass']) ? ':'.$parsed_url['pass'] : '';
27 27
         $url .= $user.(($user || $pass) ? "$pass@" : '');
28
-        if (! empty($url)) {
28
+        if (!empty($url)) {
29 29
             $url .= isset($parsed_url['path']) ? '/'.ltrim($parsed_url['path'], '/') : '';
30 30
         } elseif (empty($url)) {
31 31
             $url .= isset($parsed_url['path']) ? $parsed_url['path'] : '';
Please login to merge, or discard this patch.
src/Dialect.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -123,11 +123,11 @@  discard block
 block discarded – undo
123 123
     public function translate($routeName, $routeAttributes = null, $locale = null)
124 124
     {
125 125
         // If no locale is given, we use the current locale
126
-        if (! $locale) {
126
+        if (!$locale) {
127 127
             $locale = tongue()->current();
128 128
         }
129 129
 
130
-        if (! $this->parsed_url) {
130
+        if (!$this->parsed_url) {
131 131
             $this->parsed_url = Accent::parseCurrentUrl();
132 132
         }
133 133
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
     {
164 164
         $routePath = Accent::findRoutePathByName($routeName);
165 165
 
166
-        if (! isset($this->translatedRoutes[$routeName])) {
166
+        if (!isset($this->translatedRoutes[$routeName])) {
167 167
             $this->translatedRoutes[$routeName] = $routePath;
168 168
         }
169 169
 
Please login to merge, or discard this patch.
src/Tongue.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     {
47 47
         $locale = $this->app->getLocale();
48 48
 
49
-        if (! $key) {
49
+        if (!$key) {
50 50
             return $locale;
51 51
         }
52 52
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         //fallback language is the same as the current language
90 90
         if (Config::beautify() && $this->current() === Config::fallbackLocale()) {
91 91
             //didn't found locale means browser is set to exmaple.com
92
-            if (! $locale) {
92
+            if (!$locale) {
93 93
                 return false;
94 94
             }
95 95
             //browser is set to en.example.com but should be forced back to example.com
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
      */
112 112
     public function speaks(string $locale)
113 113
     {
114
-        if (! $this->isSpeaking($locale)) {
114
+        if (!$this->isSpeaking($locale)) {
115 115
             return abort(404); //oder error?
116 116
         }
117 117
 
@@ -153,15 +153,15 @@  discard block
 block discarded – undo
153 153
     {
154 154
         $locales = Config::supportedLocales();
155 155
 
156
-        if (empty($locales) || ! is_array($locales)) {
156
+        if (empty($locales) || !is_array($locales)) {
157 157
             throw new SupportedLocalesNotDefined();
158 158
         }
159 159
 
160
-        if (! $key) {
160
+        if (!$key) {
161 161
             return collect($locales);
162 162
         }
163 163
 
164
-        if (! array_has($locales, "{$locale}.{$key}")) {
164
+        if (!array_has($locales, "{$locale}.{$key}")) {
165 165
             throw new SupportedLocalesNotDefined();
166 166
         }
167 167
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
      */
177 177
     protected function findLocale()
178 178
     {
179
-        if (! Config::subdomain()) {
179
+        if (!Config::subdomain()) {
180 180
             return false; //use Mcamara Localization
181 181
         }
182 182
 
Please login to merge, or discard this patch.
src/helpers.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,13 +3,13 @@
 block discarded – undo
3 3
 use Pmochine\LaravelTongue\Tongue;
4 4
 use Pmochine\LaravelTongue\Dialect;
5 5
 
6
-if (! function_exists('tongue')) {
6
+if (!function_exists('tongue')) {
7 7
     function tongue()
8 8
     {
9 9
         return app()->make(Tongue::class);
10 10
     }
11 11
 }
12
-if (! function_exists('dialect')) {
12
+if (!function_exists('dialect')) {
13 13
     function dialect()
14 14
     {
15 15
         return app()->make(Dialect::class);
Please login to merge, or discard this patch.
src/ServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@
 block discarded – undo
20 20
             'localization'
21 21
         );
22 22
 
23
-        $this->app->singleton('tongue', function ($app) {
23
+        $this->app->singleton('tongue', function($app) {
24 24
             return new Tongue($app);
25 25
         });
26 26
 
27
-        $this->app->singleton('dialect', function ($app) {
27
+        $this->app->singleton('dialect', function($app) {
28 28
             return new Dialect($app);
29 29
         });
30 30
     }
Please login to merge, or discard this patch.