Passed
Push — master ( 26152a...8fe73e )
by F
04:04
created
src/Middleware/Locale.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
      *
24 24
      * @return mixed
25 25
      */
26
-    public function handle(Request $request, Closure $next)
26
+    public function handle (Request $request, Closure $next)
27 27
     {
28 28
         $session = $request->getSession();
29 29
 
Please login to merge, or discard this patch.
src/LocalisationRegistrar.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      *
110 110
      * @param \Illuminate\Cache\CacheManager $cacheManager The cache manager object
111 111
      */
112
-    public function __construct(CacheManager $cacheManager)
112
+    public function __construct (CacheManager $cacheManager)
113 113
     {
114 114
         $this->addressClass = config('pwweb.localisation.models.address');
115 115
         $this->addressTypeClass = config('pwweb.localisation.models.address_type');
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
      *
127 127
      * @return void
128 128
      */
129
-    protected function initializeCache()
129
+    protected function initializeCache ()
130 130
     {
131 131
         self::$cacheExpirationTime = config('pwweb.localisation.cache.expiration_time', config('pwweb.localisation.cache_expiration_time'));
132 132
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      *
142 142
      * @return Repository Cache store
143 143
      */
144
-    protected function getCacheStoreFromConfig(): Repository
144
+    protected function getCacheStoreFromConfig (): Repository
145 145
     {
146 146
         // the 'default' fallback here is from the localisation.php config file, where 'default' means to use config(cache.default)
147 147
         $cacheDriver = config('pwweb.localisation.cache.store', 'default');
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
      *
165 165
      * @return bool
166 166
      */
167
-    public function registerLanguages(): bool
167
+    public function registerLanguages (): bool
168 168
     {
169 169
         return true;
170 170
     }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
      *
175 175
      * @return bool
176 176
      */
177
-    public function forgetCachedAddresses()
177
+    public function forgetCachedAddresses ()
178 178
     {
179 179
         $this->addresses = null;
180 180
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
      *
187 187
      * @return bool
188 188
      */
189
-    public function forgetCachedLanguages()
189
+    public function forgetCachedLanguages ()
190 190
     {
191 191
         $this->languages = null;
192 192
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
      *
201 201
      * @return void
202 202
      */
203
-    public function clearClassLanguages()
203
+    public function clearClassLanguages ()
204 204
     {
205 205
         $this->languages = null;
206 206
     }
@@ -212,13 +212,13 @@  discard block
 block discarded – undo
212 212
      *
213 213
      * @return \Illuminate\Support\Collection
214 214
      */
215
-    public function getAddresses(array $params = []): Collection
215
+    public function getAddresses (array $params = []): Collection
216 216
     {
217 217
         if (null === $this->addresses) {
218 218
             $this->addresses = $this->cache->remember(
219
-                self::$cacheKey . '.addresses',
219
+                self::$cacheKey.'.addresses',
220 220
                 self::$cacheExpirationTime,
221
-                function () {
221
+                function() {
222 222
                     return $this->getAddressClass()
223 223
                         //->with('system_address_types')
224 224
                         ->get();
@@ -243,13 +243,13 @@  discard block
 block discarded – undo
243 243
      *
244 244
      * @return \Illuminate\Support\Collection
245 245
      */
246
-    public function getLanguages(array $params = []): Collection
246
+    public function getLanguages (array $params = []): Collection
247 247
     {
248 248
         if (null === $this->languages) {
249 249
             $this->languages = $this->cache->remember(
250 250
                 self::$cacheKey,
251 251
                 self::$cacheExpirationTime,
252
-                function () {
252
+                function() {
253 253
                     return $this->getLanguageClass()
254 254
                     //->with('countries')
255 255
                         ->get();
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
      *
272 272
      * @return PWWeb\Localisation\Contract\Address
273 273
      */
274
-    public function getAddressClass(): Address
274
+    public function getAddressClass (): Address
275 275
     {
276 276
         return app($this->addressClass);
277 277
     }
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
      *
282 282
      * @return PWWeb\Localisation\Contract\Address\Type
283 283
      */
284
-    public function getAddressTypeClass(): AddressType
284
+    public function getAddressTypeClass (): AddressType
285 285
     {
286 286
         return app($this->addressTypeClass);
287 287
     }
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
      *
292 292
      * @return PWWeb\Localisation\Contract\Country
293 293
      */
294
-    public function getCountryClass(): Country
294
+    public function getCountryClass (): Country
295 295
     {
296 296
         return app($this->countryClass);
297 297
     }
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
      *
302 302
      * @return PWWeb\Localisation\Contract\Currency
303 303
      */
304
-    public function getCurrencyClass(): Currency
304
+    public function getCurrencyClass (): Currency
305 305
     {
306 306
         return app($this->currencyClass);
307 307
     }
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
      *
312 312
      * @return PWWeb\Localisation\Contract\Language
313 313
      */
314
-    public function getLanguageClass(): Language
314
+    public function getLanguageClass (): Language
315 315
     {
316 316
         return app($this->languageClass);
317 317
     }
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
      *
324 324
      * @return object
325 325
      */
326
-    public function setAddressClass(string $addressClass)
326
+    public function setAddressClass (string $addressClass)
327 327
     {
328 328
         $this->addressClass = $addressClass;
329 329
 
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
      *
338 338
      * @return object
339 339
      */
340
-    public function setLanguageClass(string $languageClass)
340
+    public function setLanguageClass (string $languageClass)
341 341
     {
342 342
         $this->languageClass = $languageClass;
343 343
 
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
      *
350 350
      * @return \Illuminate\Contracts\Cache\Store
351 351
      */
352
-    public function getCacheStore(): \Illuminate\Contracts\Cache\Store
352
+    public function getCacheStore (): \Illuminate\Contracts\Cache\Store
353 353
     {
354 354
         return $this->cache->getStore();
355 355
     }
Please login to merge, or discard this patch.
src/Exceptions/AddressDoesNotExist.php 1 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
      *
24 24
      * @return static
25 25
      */
26
-    public static function create(string $addressName)
26
+    public static function create (string $addressName)
27 27
     {
28 28
         return new static("There is no address named `{$addressName}`.");
29 29
     }
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      *
36 36
      * @return static
37 37
      */
38
-    public static function withId(int $addressId)
38
+    public static function withId (int $addressId)
39 39
     {
40 40
         return new static("There is no [address] with id `{$addressId}`.");
41 41
     }
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      *
48 48
      * @return static
49 49
      */
50
-    public static function withType(string $addressType)
50
+    public static function withType (string $addressType)
51 51
     {
52 52
         return new static("There is no [address] with type `{$addressType}`.");
53 53
     }
Please login to merge, or discard this patch.
src/Controllers/LanguageController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
      *
16 16
      * @return \Illuminate\Contracts\Support\Renderable
17 17
      */
18
-    public function switch($locale)
18
+    public function switch ($locale)
19 19
     {
20 20
         $locales = (array) Language::getLocales();
21 21
 
Please login to merge, or discard this patch.
src/Controllers/AddressController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      *
14 14
      * @return \Illuminate\Contracts\Support\Renderable
15 15
      */
16
-    public function index()
16
+    public function index ()
17 17
     {
18 18
     }
19 19
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      *
23 23
      * @return \Illuminate\Contracts\Support\Renderable
24 24
      */
25
-    public function create()
25
+    public function create ()
26 26
     {
27 27
         $types = Type::all();
28 28
         $countries = Country::all();
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      *
36 36
      * @return \Illuminate\Contracts\Support\Renderable
37 37
      */
38
-    public function store()
38
+    public function store ()
39 39
     {
40 40
     }
41 41
 }
Please login to merge, or discard this patch.
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 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/Models/Currency.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
      *
32 32
      * @param array $attributes additional attributes for model initialisation
33 33
      */
34
-    public function __construct(array $attributes = [])
34
+    public function __construct (array $attributes = [])
35 35
     {
36 36
         parent::__construct($attributes);
37 37
 
Please login to merge, or discard this patch.
src/Models/Address.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      *
39 39
      * @return void
40 40
      */
41
-    public function __construct(array $attributes = [])
41
+    public function __construct (array $attributes = [])
42 42
     {
43 43
         parent::__construct($attributes);
44 44
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      *
51 51
      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
52 52
      */
53
-    public function type(): BelongsTo
53
+    public function type (): BelongsTo
54 54
     {
55 55
         return $this->belongsTo(Address\Type::class);
56 56
     }
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      *
61 61
      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
62 62
      */
63
-    public function country(): BelongsTo
63
+    public function country (): BelongsTo
64 64
     {
65 65
         return $this->belongsTo(Country::class);
66 66
     }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      *
75 75
      * @return \PWWEB\Localisation\Contracts\Address
76 76
      */
77
-    public static function findById(int $id): AddressContract
77
+    public static function findById (int $id): AddressContract
78 78
     {
79 79
         $address = static::getAddresses(['id' => $id])->first();
80 80
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      *
95 95
      * @return \PWWEB\Localisation\Contracts\Address
96 96
      */
97
-    public static function findByType(string $type): AddressContract
97
+    public static function findByType (string $type): AddressContract
98 98
     {
99 99
         $address = static::getAddresses(['type' => $type])->first();
100 100
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
      *
113 113
      * @return Collection collection of addresses
114 114
      */
115
-    protected static function getAddresses(array $params = []): Collection
115
+    protected static function getAddresses (array $params = []): Collection
116 116
     {
117 117
         return app(LocalisationRegistrar::class)
118 118
             ->setAddressClass(static::class)
Please login to merge, or discard this patch.
src/Models/Language.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      *
29 29
      * @return void
30 30
      */
31
-    public function __construct(array $attributes = [])
31
+    public function __construct (array $attributes = [])
32 32
     {
33 33
         parent::__construct($attributes);
34 34
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      *
41 41
      * @return BelongsToMany countries the language belongs to
42 42
      */
43
-    public function countries(): BelongsToMany
43
+    public function countries (): BelongsToMany
44 44
     {
45 45
         return $this->belongsToMany(
46 46
             config('pwweb.localisation.models.countries'),
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      *
60 60
      * @return \PWWEB\Localisation\Contracts\Language
61 61
      */
62
-    public static function findByName(string $name): LanguageContract
62
+    public static function findByName (string $name): LanguageContract
63 63
     {
64 64
         $language = static::getLanguages(['name' => $name])->first();
65 65
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      *
80 80
      * @return \PWWEB\Localisation\Contracts\Language
81 81
      */
82
-    public static function findById(int $id): LanguageContract
82
+    public static function findById (int $id): LanguageContract
83 83
     {
84 84
         $language = static::getLanguages(['id' => $id])->first();
85 85
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
      *
100 100
      * @return \PWWEB\Localisation\Contracts\Language
101 101
      */
102
-    public static function findByLocale(string $locale): LanguageContract
102
+    public static function findByLocale (string $locale): LanguageContract
103 103
     {
104 104
         $language = static::getLanguages(['locale' => $locale])->first();
105 105
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      *
118 118
      * @return Collection collection of languages
119 119
      */
120
-    protected static function getLanguages(array $params = []): Collection
120
+    protected static function getLanguages (array $params = []): Collection
121 121
     {
122 122
         return app(LocalisationRegistrar::class)
123 123
             ->setLanguageClass(static::class)
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
      *
132 132
      * @return array
133 133
      */
134
-    protected static function getLocales(array $params = []): array
134
+    protected static function getLocales (array $params = []): array
135 135
     {
136 136
         $locales = [];
137 137
         $languages = self::getLanguages($params);
Please login to merge, or discard this patch.