Completed
Branch master (dcaefe)
by Philipp
04:02
created
Category
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.
config/localization.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -74,24 +74,24 @@  discard block
 block discarded – undo
74 74
         //'cy'          => ['name' => 'Welsh',                  'script' => 'Latn', 'native' => 'Cymraeg', 'regional' => 'cy_GB'],
75 75
         //'da'          => ['name' => 'Danish',                 'script' => 'Latn', 'native' => 'dansk', 'regional' => 'da_DK'],
76 76
         //'se'          => ['name' => 'Northern Sami',          'script' => 'Latn', 'native' => 'davvisámegiella', 'regional' => 'se_NO'],
77
-        'de'          => ['name' => 'German',                 'script' => 'Latn', 'native' => 'Deutsch', 'regional' => 'de_DE'],
77
+        'de'          => ['name' => 'German', 'script' => 'Latn', 'native' => 'Deutsch', 'regional' => 'de_DE'],
78 78
         //'luo'         => ['name' => 'Luo',                    'script' => 'Latn', 'native' => 'Dholuo', 'regional' => ''],
79 79
         //'nv'          => ['name' => 'Navajo',                 'script' => 'Latn', 'native' => 'Diné bizaad', 'regional' => ''],
80 80
         //'dua'         => ['name' => 'Duala',                  'script' => 'Latn', 'native' => 'duálá', 'regional' => ''],
81 81
         //'et'          => ['name' => 'Estonian',               'script' => 'Latn', 'native' => 'eesti', 'regional' => 'et_EE'],
82 82
         //'na'          => ['name' => 'Nauru',                  'script' => 'Latn', 'native' => 'Ekakairũ Naoero', 'regional' => ''],
83 83
         //'guz'         => ['name' => 'Ekegusii',               'script' => 'Latn', 'native' => 'Ekegusii', 'regional' => ''],
84
-        'en'          => ['name' => 'English',                'script' => 'Latn', 'native' => 'English', 'regional' => 'en_GB'],
84
+        'en'          => ['name' => 'English', 'script' => 'Latn', 'native' => 'English', 'regional' => 'en_GB'],
85 85
         //'en-AU'       => ['name' => 'Australian English',     'script' => 'Latn', 'native' => 'Australian English', 'regional' => 'en_AU'],
86 86
         //'en-GB'       => ['name' => 'British English',        'script' => 'Latn', 'native' => 'British English', 'regional' => 'en_GB'],
87 87
         //'en-US'       => ['name' => 'U.S. English',           'script' => 'Latn', 'native' => 'U.S. English', 'regional' => 'en_US'],
88
-        'es'          => ['name' => 'Spanish',                'script' => 'Latn', 'native' => 'español', 'regional' => 'es_ES'],
88
+        'es'          => ['name' => 'Spanish', 'script' => 'Latn', 'native' => 'español', 'regional' => 'es_ES'],
89 89
         //'eo'          => ['name' => 'Esperanto',              'script' => 'Latn', 'native' => 'esperanto', 'regional' => ''],
90 90
         //'eu'          => ['name' => 'Basque',                 'script' => 'Latn', 'native' => 'euskara', 'regional' => 'eu_ES'],
91 91
         //'ewo'         => ['name' => 'Ewondo',                 'script' => 'Latn', 'native' => 'ewondo', 'regional' => ''],
92 92
         //'ee'          => ['name' => 'Ewe',                    'script' => 'Latn', 'native' => 'eʋegbe', 'regional' => ''],
93 93
         //'fil'         => ['name' => 'Filipino',               'script' => 'Latn', 'native' => 'Filipino', 'regional' => 'fil_PH'],
94
-        'fr'          => ['name' => 'French',                 'script' => 'Latn', 'native' => 'français', 'regional' => 'fr_FR'],
94
+        'fr'          => ['name' => 'French', 'script' => 'Latn', 'native' => 'français', 'regional' => 'fr_FR'],
95 95
         //'fr-CA'       => ['name' => 'Canadian French',        'script' => 'Latn', 'native' => 'français canadien', 'regional' => 'fr_CA'],
96 96
         //'fy'          => ['name' => 'Western Frisian',        'script' => 'Latn', 'native' => 'frysk', 'regional' => 'fy_DE'],
97 97
         //'fur'         => ['name' => 'Friulian',               'script' => 'Latn', 'native' => 'furlan', 'regional' => 'fur_IT'],
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         //'lg'          => ['name' => 'Ganda',                  'script' => 'Latn', 'native' => 'Luganda', 'regional' => 'lg_UG'],
163 163
         //'luy'         => ['name' => 'Oluluyia',               'script' => 'Latn', 'native' => 'Luluhia', 'regional' => ''],
164 164
         //'lb'          => ['name' => 'Luxembourgish',          'script' => 'Latn', 'native' => 'Lëtzebuergesch', 'regional' => 'lb_LU'],
165
-        'hu'          => ['name' => 'Hungarian',              'script' => 'Latn', 'native' => 'magyar', 'regional' => 'hu_HU'],
165
+        'hu'          => ['name' => 'Hungarian', 'script' => 'Latn', 'native' => 'magyar', 'regional' => 'hu_HU'],
166 166
         //'mgh'         => ['name' => 'Makhuwa-Meetto',         'script' => 'Latn', 'native' => 'Makua', 'regional' => ''],
167 167
         //'mg'          => ['name' => 'Malagasy',               'script' => 'Latn', 'native' => 'Malagasy', 'regional' => 'mg_MG'],
168 168
         //'mt'          => ['name' => 'Maltese',                'script' => 'Latn', 'native' => 'Malti', 'regional' => 'mt_MT'],
Please login to merge, or discard this patch.