Passed
Push — master ( 1abbd8...a8d94b )
by Vasyl
02:27
created
config/url-aliases-laravellocalization.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,11 +42,11 @@
 block discarded – undo
42 42
         //'et'          => ['name' => 'Estonian',               'script' => 'Latn', 'native' => 'eesti', 'regional' => 'et_EE'],
43 43
         //'na'          => ['name' => 'Nauru',                  'script' => 'Latn', 'native' => 'Ekakairũ Naoero', 'regional' => ''],
44 44
         //'guz'         => ['name' => 'Ekegusii',               'script' => 'Latn', 'native' => 'Ekegusii', 'regional' => ''],
45
-        'en'          => ['name' => 'English',                'script' => 'Latn', 'native' => 'English', 'regional' => 'en_GB'],
45
+        'en'          => ['name' => 'English', 'script' => 'Latn', 'native' => 'English', 'regional' => 'en_GB'],
46 46
         //'en-AU'       => ['name' => 'Australian English',     'script' => 'Latn', 'native' => 'Australian English', 'regional' => 'en_AU'],
47 47
         //'en-GB'       => ['name' => 'British English',        'script' => 'Latn', 'native' => 'British English', 'regional' => 'en_GB'],
48 48
         //'en-US'       => ['name' => 'U.S. English',           'script' => 'Latn', 'native' => 'U.S. English', 'regional' => 'en_US'],
49
-        'es'          => ['name' => 'Spanish',                'script' => 'Latn', 'native' => 'español', 'regional' => 'es_ES'],
49
+        'es'          => ['name' => 'Spanish', 'script' => 'Latn', 'native' => 'español', 'regional' => 'es_ES'],
50 50
         //'eo'          => ['name' => 'Esperanto',              'script' => 'Latn', 'native' => 'esperanto', 'regional' => ''],
51 51
         //'eu'          => ['name' => 'Basque',                 'script' => 'Latn', 'native' => 'euskara', 'regional' => 'eu_ES'],
52 52
         //'ewo'         => ['name' => 'Ewondo',                 'script' => 'Latn', 'native' => 'ewondo', 'regional' => ''],
Please login to merge, or discard this patch.
src/Traits/Localization.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
 
69 69
         $order = $this->config->get('url-aliases-laravellocalization.localesOrder');
70 70
 
71
-        uksort($locales, function ($a, $b) use ($order) {
71
+        uksort($locales, function($a, $b) use ($order) {
72 72
             $pos_a = array_search($a, $order);
73 73
             $pos_b = array_search($b, $order);
74 74
             return $pos_a - $pos_b;
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
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
             return [];
42 42
         }
43 43
 
44
-        return ! is_array($value) ? [$value] : $value;
44
+        return !is_array($value) ? [$value] : $value;
45 45
     }
46 46
 }
47 47
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     {
91 91
         $segments = explode('/', $path);
92 92
 
93
-        $array = array_values(array_filter($segments, function ($value) {
93
+        $array = array_values(array_filter($segments, function($value) {
94 94
             return $value !== '';
95 95
         }));
96 96
 
Please login to merge, or discard this patch.
src/Models/UrlAlias.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@
 block discarded – undo
12 12
 
13 13
     protected static function boot()
14 14
     {
15
-        static::creating(function (Model $model) {
16
-            if (! $model->locale) {
15
+        static::creating(function(Model $model) {
16
+            if (!$model->locale) {
17 17
                 $model->locale = app()->app['config']->get('app.locale');
18 18
             }
19 19
         });
Please login to merge, or discard this patch.
src/ServiceProvider.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -32,14 +32,14 @@  discard block
 block discarded – undo
32 32
      */
33 33
     public function register()
34 34
     {
35
-        $this->mergeConfigFrom(__DIR__.'/../config/url-aliases.php', 'url-aliases');
36
-        $this->mergeConfigFrom(__DIR__.'/../config/url-aliases-laravellocalization.php', 'url-aliases-laravellocalization');
35
+        $this->mergeConfigFrom(__DIR__ . '/../config/url-aliases.php', 'url-aliases');
36
+        $this->mergeConfigFrom(__DIR__ . '/../config/url-aliases-laravellocalization.php', 'url-aliases-laravellocalization');
37 37
 
38
-        $this->app->singleton(UrlAliasLocalization::class, function () {
38
+        $this->app->singleton(UrlAliasLocalization::class, function() {
39 39
             return new UrlAliasLocalization($this->app);
40 40
         });
41 41
 
42
-        $this->app->singleton(UrlAlias::class, function () {
42
+        $this->app->singleton(UrlAlias::class, function() {
43 43
             return new UrlAlias($this->app);
44 44
         });
45 45
     }
@@ -62,10 +62,10 @@  discard block
 block discarded – undo
62 62
 
63 63
     protected function publishMigrations()
64 64
     {
65
-        if (! class_exists('CreateUrlAliasesTable')) {
65
+        if (!class_exists('CreateUrlAliasesTable')) {
66 66
             $timestamp = date('Y_m_d_His', time());
67 67
 
68
-            $migrationPath = __DIR__.'/../database/migrations/create_url_aliases_table.php';
68
+            $migrationPath = __DIR__ . '/../database/migrations/create_url_aliases_table.php';
69 69
                 $this->publishes([$migrationPath => database_path('/migrations/' . $timestamp . '_create_url_aliases_table.php'),
70 70
             ], 'url-aliases-migrations');
71 71
         }
Please login to merge, or discard this patch.
database/migrations/create_url_aliases_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('url_aliases', function (Blueprint $table) {
16
+        Schema::create('url_aliases', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->string('source')->index();
19 19
             $table->string('alias')->index();
Please login to merge, or discard this patch.
src/UrlAliasLocalization.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     public function __construct($app)
26 26
     {
27 27
         if (!$app) {
28
-            $app = app();   //Fallback when $app is not given
28
+            $app = app(); //Fallback when $app is not given
29 29
         }
30 30
         $this->app = $app;
31 31
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         foreach ($this->supportedLocales as $key => $item) {
123 123
             if ($modelClass = $aliasModels->where('locale', $key)->first()) {
124 124
                 $link = $modelClass->localeAlias;
125
-            } elseif($default) {
125
+            } elseif ($default) {
126 126
                 $link = $default;
127 127
             } else {
128 128
                 $link = $key;
Please login to merge, or discard this patch.
src/UrlAlias.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
             if ($entity->urlAlias) {
40 40
                 unset($parameters[0]);
41 41
                 if (! $this->config->get('url-aliases.use_localization')) {
42
-                	$alias = $entity->urlAlias->alias;
42
+                    $alias = $entity->urlAlias->alias;
43 43
                 } elseif ($this->config->get('url-aliases-laravellocalization.origin_default_locale') == $entity->urlAlias->locale && $this->config->get('url-aliases-laravellocalization.hideDefaultLocaleInURL') && !$forceWithLocalePrefix) {
44 44
                     $alias = $entity->urlAlias->alias;
45 45
                 } else {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     public function __construct($app = null)
24 24
     {
25 25
         if (!$app) {
26
-            $app = app();   //Fallback when $app is not given
26
+            $app = app(); //Fallback when $app is not given
27 27
         }
28 28
         $this->app = $app;
29 29
 
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
     {
35 35
         $parameters = array_wrap($parameters);
36 36
 
37
-        if (! empty($parameters[0]) && ($parameters[0] instanceof \Illuminate\Database\Eloquent\Model)) {
37
+        if (!empty($parameters[0]) && ($parameters[0] instanceof \Illuminate\Database\Eloquent\Model)) {
38 38
             $entity = $parameters[0];
39 39
             if ($entity->urlAlias) {
40 40
                 unset($parameters[0]);
41
-                if (! $this->config->get('url-aliases.use_localization')) {
41
+                if (!$this->config->get('url-aliases.use_localization')) {
42 42
                 	$alias = $entity->urlAlias->alias;
43 43
                 } elseif ($this->config->get('url-aliases-laravellocalization.origin_default_locale') == $entity->urlAlias->locale && $this->config->get('url-aliases-laravellocalization.hideDefaultLocaleInURL') && !$forceWithLocalePrefix) {
44 44
                     $alias = $entity->urlAlias->alias;
Please login to merge, or discard this patch.
src/Middleware/UrlAliasMiddleware.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@
 block discarded – undo
129 129
             $request->getContent()
130 130
         );
131 131
         
132
-       //...
132
+        //...
133 133
         return $next($request);
134 134
     }
135 135
 
Please login to merge, or discard this patch.