Completed
Push — master ( 8877c9...0f6ba2 )
by Aitor Riba
01:52
created
src/Migrations/2016_11_28_115831_add_locale_column.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::table('users', function ($table) {
16
+        Schema::table('users', function($table) {
17 17
             $table->string('locale')->default(App::getLocale());
18 18
         });
19 19
     }
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function down()
27 27
     {
28
-        Schema::table('users', function ($table) {
28
+        Schema::table('users', function($table) {
29 29
             $table->dropColumn('locale');
30 30
         });
31 31
     }
Please login to merge, or discard this patch.
src/Routes/web.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
         'as'         => 'localizer::',
7 7
         'prefix'     => config('localizer.prefix'),
8 8
         'namespace'  => 'Aitor24\Localizer\Controllers',
9
-    ], function () {
9
+    ], function() {
10 10
         Route::get('/set/{locale}/', 'LocalizerController@set')->name('setLocale');
11 11
         if (config('localizer.homeRoute')) {
12 12
             Route::get('/set/{locale}/home', 'LocalizerController@setHome')->name('setLocaleHome');
Please login to merge, or discard this patch.
src/Middlewares/LocalizerMiddleware.php 1 patch
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,6 @@
 block discarded – undo
28 28
     /**
29 29
      * This function checks if user is logged in, and loads the prefered language.
30 30
      *
31
-     * @param string $lang
32 31
      **/
33 32
     public function setLang($request)
34 33
     {
Please login to merge, or discard this patch.
src/Builder.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
      **/
28 28
     public static function isAllowedLanguage($code)
29 29
     {
30
-        return in_array($code, array_keys(self::allowedLanguages()) );
30
+        return in_array($code, array_keys(self::allowedLanguages()));
31 31
     }
32 32
 
33 33
     /**
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -117,7 +117,9 @@  discard block
 block discarded – undo
117 117
      **/
118 118
     public static function getCode($name = 'default')
119 119
     {
120
-        if ($name == 'default') $name = self::getLanguage();
120
+        if ($name == 'default') {
121
+            $name = self::getLanguage();
122
+        }
121 123
 
122 124
         return self::addCodes([$name])[$name];
123 125
     }
@@ -129,7 +131,9 @@  discard block
 block discarded – undo
129 131
      **/
130 132
     public static function getLanguage($code = 'default')
131 133
     {
132
-        if ($code == 'default') $code = App::getLocale();
134
+        if ($code == 'default') {
135
+            $code = App::getLocale();
136
+        }
133 137
         return self::addNames([$code])[$code];
134 138
     }
135 139
 }
Please login to merge, or discard this patch.