Passed
Push — master ( a6b111...37c75f )
by F
03:14
created
src/Models/Country.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      *
26 26
      * @return void
27 27
      */
28
-    public function __construct(array $attributes = [])
28
+    public function __construct (array $attributes = [])
29 29
     {
30 30
         parent::__construct($attributes);
31 31
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      *
38 38
      * @return \Illuminate\Database\Eloquent\Relations\HasMany collection of languages used in the country
39 39
      */
40
-    public function languages(): HasMany
40
+    public function languages (): HasMany
41 41
     {
42 42
         return $this->hasMany(
43 43
             config('pwweb.localisation.models.languages'),
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
      *
55 55
      * @return string|array Localised country name.
56 56
      */
57
-    public function getNameAttribute($value)
57
+    public function getNameAttribute ($value)
58 58
     {
59 59
         if (null === $value || '' === $value) {
60 60
             return '';
61 61
         }
62 62
 
63
-        return __('pwweb::localization.' . $value);
63
+        return __('pwweb::localization.'.$value);
64 64
     }
65 65
 }
Please login to merge, or discard this patch.
src/Localisation.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      *
47 47
      * @param \Illuminate\Foundation\Application $app laravel application for further use
48 48
      */
49
-    public function __construct($app = null)
49
+    public function __construct ($app = null)
50 50
     {
51 51
         if (null === $app) {
52 52
             $app = app();
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      *
64 64
      * @return \Illuminate\Database\Eloquent\Collection a collection of active languages
65 65
      */
66
-    public static function languages(): Collection
66
+    public static function languages (): Collection
67 67
     {
68 68
         return Language::where('active', 1)->get();
69 69
     }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      *
76 76
      * @return \PWWEB\Localisation\Contracts\Language A language object
77 77
      */
78
-    public static function currentLanguage(string $locale = ''): LanguageContract
78
+    public static function currentLanguage (string $locale = ''): LanguageContract
79 79
     {
80 80
         $fallbackLocale = config('app.fallback_locale');
81 81
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         } else if ($locale === $fallbackLocale) {
85 85
             $locale = 'en-GB';
86 86
         } else {
87
-            $locale = $fallbackLocale . '-' . strtoupper($fallbackLocale);
87
+            $locale = $fallbackLocale.'-'.strtoupper($fallbackLocale);
88 88
         }
89 89
 
90 90
         try {
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      *
102 102
      * @return \Illuminate\Contracts\Support\Renderable language selector / switcher markup
103 103
      */
104
-    public static function languageSelector(): Renderable
104
+    public static function languageSelector (): Renderable
105 105
     {
106 106
         $languages = self::languages();
107 107
         $current = self::currentLanguage();
Please login to merge, or discard this patch.
src/LocalisationServiceProvider.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
      *
28 28
      * @return void
29 29
      */
30
-    public function register()
30
+    public function register ()
31 31
     {
32 32
         $this->mergeConfigFrom(
33
-            __DIR__ . '/../config/localisation.php',
33
+            __DIR__.'/../config/localisation.php',
34 34
             'pwweb.localisation'
35 35
         );
36 36
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         $this->app->make('PWWEB\Localisation\Controllers\IndexController');
39 39
 
40 40
         // Register views.
41
-        $this->loadViewsFrom(__DIR__ . '/resources/views', 'localisation');
41
+        $this->loadViewsFrom(__DIR__.'/resources/views', 'localisation');
42 42
     }
43 43
 
44 44
     /**
@@ -49,35 +49,35 @@  discard block
 block discarded – undo
49 49
      *
50 50
      * @return void
51 51
      */
52
-    public function boot(LocalisationRegistrar $localisationLoader, Filesystem $filesystem)
52
+    public function boot (LocalisationRegistrar $localisationLoader, Filesystem $filesystem)
53 53
     {
54
-        include __DIR__ . '/../routes/web.php';
54
+        include __DIR__.'/../routes/web.php';
55 55
 
56 56
         if (true === function_exists('config_path')) {
57 57
             // function not available and 'publish' not relevant in Lumen
58 58
             $this->publishes(
59 59
                 [
60
-                    __DIR__ . '/../config/localisation.php' => config_path('pwweb/localisation.php'),
60
+                    __DIR__.'/../config/localisation.php' => config_path('pwweb/localisation.php'),
61 61
                 ],
62 62
                 'pwweb.localisation.config'
63 63
             );
64 64
 
65 65
             $this->publishes(
66 66
                 [
67
-                    __DIR__ . '/../database/migrations/create_localisation_tables.php.stub' => $this->getMigrationFileName($filesystem),
67
+                    __DIR__.'/../database/migrations/create_localisation_tables.php.stub' => $this->getMigrationFileName($filesystem),
68 68
                 ],
69 69
                 'pwweb.localisation.migrations'
70 70
             );
71 71
 
72 72
             $this->publishes(
73 73
                 [
74
-                    __DIR__ . '/resources/lang' => resource_path('lang/vendor/pwweb'),
74
+                    __DIR__.'/resources/lang' => resource_path('lang/vendor/pwweb'),
75 75
                 ]
76 76
             );
77 77
 
78 78
             $this->publishes(
79 79
                 [
80
-                    __DIR__ . '/resources/views' => base_path('resources/views/vendor/localisation'),
80
+                    __DIR__.'/resources/views' => base_path('resources/views/vendor/localisation'),
81 81
                 ],
82 82
                 'views'
83 83
             );
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             ]
90 90
         );
91 91
 
92
-        $this->loadTranslationsFrom(realpath(__DIR__ . '/resources/lang'), 'pwweb');
92
+        $this->loadTranslationsFrom(realpath(__DIR__.'/resources/lang'), 'pwweb');
93 93
 
94 94
         $this->registerModelBindings();
95 95
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
         $this->app->singleton(
104 104
             LocalisationRegistrar::class,
105
-            function ($app) use ($localisationLoader) {
105
+            function($app) use ($localisationLoader) {
106 106
                 return $localisationLoader;
107 107
             }
108 108
         );
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      *
114 114
      * @return void
115 115
      */
116
-    protected function registerModelBindings()
116
+    protected function registerModelBindings ()
117 117
     {
118 118
         $config = $this->app->config['pwweb.localisation.models'];
119 119
 
@@ -129,16 +129,16 @@  discard block
 block discarded – undo
129 129
      *
130 130
      * @return string migration filename
131 131
      */
132
-    protected function getMigrationFileName(Filesystem $filesystem): string
132
+    protected function getMigrationFileName (Filesystem $filesystem): string
133 133
     {
134 134
         $timestamp = date('Y_m_d_His', mktime(0, 0, 0, 1, 1, 2020));
135 135
 
136
-        return Collection::make($this->app->databasePath() . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR)
136
+        return Collection::make($this->app->databasePath().DIRECTORY_SEPARATOR.'migrations'.DIRECTORY_SEPARATOR)
137 137
             ->flatMap(
138
-                function ($path) use ($filesystem) {
139
-                    return $filesystem->glob($path . '*_create_localisation_tables.php');
138
+                function($path) use ($filesystem) {
139
+                    return $filesystem->glob($path.'*_create_localisation_tables.php');
140 140
                 }
141
-            )->push($this->app->databasePath() . "/migrations/{$timestamp}_create_localisation_tables.php")
141
+            )->push($this->app->databasePath()."/migrations/{$timestamp}_create_localisation_tables.php")
142 142
             ->first();
143 143
     }
144 144
 }
Please login to merge, or discard this patch.