@@ -23,7 +23,7 @@ |
||
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 |
@@ -23,7 +23,7 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -13,7 +13,7 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -31,7 +31,7 @@ |
||
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 |
@@ -38,7 +38,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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) |
@@ -28,7 +28,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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); |
@@ -31,7 +31,7 @@ discard block |
||
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 | |
@@ -45,12 +45,12 @@ discard block |
||
45 | 45 | * |
46 | 46 | * @return string |
47 | 47 | */ |
48 | - public function getNameAttribute($value) |
|
48 | + public function getNameAttribute ($value) |
|
49 | 49 | { |
50 | 50 | if (null === $value || '' === $value) { |
51 | 51 | return ''; |
52 | 52 | } |
53 | 53 | |
54 | - return __('pwweb::localization.' . $value); |
|
54 | + return __('pwweb::localization.'.$value); |
|
55 | 55 | } |
56 | 56 | } |
@@ -46,7 +46,7 @@ discard block |
||
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 |
||
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 |
||
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 | |
@@ -101,7 +101,7 @@ discard block |
||
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(); |
@@ -15,7 +15,7 @@ |
||
15 | 15 | * |
16 | 16 | * @return \Illuminate\Http\RedirectResponse |
17 | 17 | */ |
18 | - public function switch($locale) |
|
18 | + public function switch ($locale) |
|
19 | 19 | { |
20 | 20 | $locales = (array) Language::getLocales(); |
21 | 21 |