@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | protected function registerHtmlBuilder() |
33 | 33 | { |
34 | - $this->app->singleton('html', function ($app) { |
|
34 | + $this->app->singleton('html', function($app) { |
|
35 | 35 | return new HtmlBuilder($app['url']); |
36 | 36 | }); |
37 | 37 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | protected function registerFormBuilder() |
43 | 43 | { |
44 | - $this->app->singleton('form', function ($app) { |
|
44 | + $this->app->singleton('form', function($app) { |
|
45 | 45 | $formBuilder = new FormBuilder($app['html'], $app['url'], $app['session.store']->getToken()); |
46 | 46 | |
47 | 47 | $formBuilder->setSessionStore($app['session.store']); |
@@ -35,7 +35,7 @@ |
||
35 | 35 | /** |
36 | 36 | * Get a parameter of the current route. |
37 | 37 | * |
38 | - * @param $key |
|
38 | + * @param string $key |
|
39 | 39 | * |
40 | 40 | * @return object|string |
41 | 41 | */ |
@@ -47,6 +47,6 @@ |
||
47 | 47 | |
48 | 48 | public function sanitizeUrl(string $url, string $protocol = 'http') : string |
49 | 49 | { |
50 | - return preg_replace('/^(?!https?:\/\/)/', $protocol . '://', $url) ; |
|
50 | + return preg_replace('/^(?!https?:\/\/)/', $protocol.'://', $url); |
|
51 | 51 | } |
52 | 52 | } |
@@ -38,6 +38,9 @@ |
||
38 | 38 | return fragment('auth.failed'); |
39 | 39 | } |
40 | 40 | |
41 | + /** |
|
42 | + * @param Request $request |
|
43 | + */ |
|
41 | 44 | protected function sendInactiveAccountResponse($request) |
42 | 45 | { |
43 | 46 | return redirect()->back() |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | protected function authenticated(Request $request, User $user) |
26 | 26 | { |
27 | - if (! $user->isActive()) { |
|
27 | + if (!$user->isActive()) { |
|
28 | 28 | auth()->guard('front')->logout(); |
29 | 29 | |
30 | 30 | return $this->sendInactiveAccountResponse($request); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | { |
9 | 9 | public function equals(Enum $enum) : bool |
10 | 10 | { |
11 | - if (! $enum instanceof $this) { |
|
11 | + if (!$enum instanceof $this) { |
|
12 | 12 | throw new EnumTypesDontMatch(); |
13 | 13 | } |
14 | 14 | |
@@ -17,12 +17,12 @@ discard block |
||
17 | 17 | |
18 | 18 | public function doesntEqual(Enum $enum) : bool |
19 | 19 | { |
20 | - return ! $this->equals($enum); |
|
20 | + return !$this->equals($enum); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | public static function allAsRegex() : string |
24 | 24 | { |
25 | - return collect(static::values())->map(function ($value) { |
|
25 | + return collect(static::values())->map(function($value) { |
|
26 | 26 | return "({$value})"; |
27 | 27 | })->implode('|'); |
28 | 28 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | return $constants; |
124 | 124 | } |
125 | 125 | |
126 | - return array_filter($constants, function ($key) use ($startsWithFilter) { |
|
126 | + return array_filter($constants, function($key) use ($startsWithFilter) { |
|
127 | 127 | return starts_with(strtolower($key), strtolower($startsWithFilter)); |
128 | 128 | }, ARRAY_FILTER_USE_KEY); |
129 | 129 | } |
@@ -146,14 +146,13 @@ discard block |
||
146 | 146 | function current_user() |
147 | 147 | { |
148 | 148 | return app(App\Services\Navigation\Section::class)->isFront() ? |
149 | - current_front_user() : |
|
150 | - current_back_user(); |
|
149 | + current_front_user() : current_back_user(); |
|
151 | 150 | } |
152 | 151 | |
153 | 152 | /** @return \App\Services\Auth\Front\User|null */ |
154 | 153 | function current_front_user() |
155 | 154 | { |
156 | - if (! auth()->guard('front')->check()) { |
|
155 | + if (!auth()->guard('front')->check()) { |
|
157 | 156 | return null; |
158 | 157 | } |
159 | 158 | |
@@ -163,7 +162,7 @@ discard block |
||
163 | 162 | /** @return \App\Services\Auth\Back\User|null */ |
164 | 163 | function current_back_user() |
165 | 164 | { |
166 | - if (! auth()->guard('back')->check()) { |
|
165 | + if (!auth()->guard('back')->check()) { |
|
167 | 166 | return null; |
168 | 167 | } |
169 | 168 | |
@@ -173,15 +172,13 @@ discard block |
||
173 | 172 | function login_url() : string |
174 | 173 | { |
175 | 174 | return app(App\Services\Navigation\Section::class)->isFront() ? |
176 | - action('Front\AuthController@getLogin') : |
|
177 | - action('Back\AuthController@getLogin'); |
|
175 | + action('Front\AuthController@getLogin') : action('Back\AuthController@getLogin'); |
|
178 | 176 | } |
179 | 177 | |
180 | 178 | function logout_url() : string |
181 | 179 | { |
182 | 180 | return app(App\Services\Navigation\Section::class)->isFront() ? |
183 | - action('Front\AuthController@getLogout') : |
|
184 | - action('Back\AuthController@getLogout'); |
|
181 | + action('Front\AuthController@getLogout') : action('Back\AuthController@getLogout'); |
|
185 | 182 | } |
186 | 183 | |
187 | 184 | function register_url() : string |
@@ -212,7 +209,7 @@ discard block |
||
212 | 209 | |
213 | 210 | function lang_to_fragments(string $namespace, array $names, array $defaults = []) : array |
214 | 211 | { |
215 | - return array_reduce($names, function ($carry, $name) use ($namespace) { |
|
212 | + return array_reduce($names, function($carry, $name) use ($namespace) { |
|
216 | 213 | $carry[$name] = fragment("{$namespace}.{$name}"); |
217 | 214 | |
218 | 215 | return $carry; |
@@ -57,7 +57,7 @@ |
||
57 | 57 | { |
58 | 58 | $user = $this->frontUserRepository->find($id); |
59 | 59 | |
60 | - if (! $user) abort(404); |
|
60 | + if (!$user) abort(404); |
|
61 | 61 | |
62 | 62 | return view('back.frontUsers.edit')->with(compact('user')); |
63 | 63 | } |
@@ -57,7 +57,9 @@ |
||
57 | 57 | { |
58 | 58 | $user = $this->frontUserRepository->find($id); |
59 | 59 | |
60 | - if (! $user) abort(404); |
|
60 | + if (! $user) { |
|
61 | + abort(404); |
|
62 | + } |
|
61 | 63 | |
62 | 64 | return view('back.frontUsers.edit')->with(compact('user')); |
63 | 65 | } |
@@ -10,7 +10,7 @@ |
||
10 | 10 | { |
11 | 11 | public function handle($request, Closure $next) |
12 | 12 | { |
13 | - if (! current_user()) { |
|
13 | + if (!current_user()) { |
|
14 | 14 | return $this->handleUnauthorizedRequest($request); |
15 | 15 | } |
16 | 16 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | */ |
42 | 42 | protected function protectedByDemoMode() |
43 | 43 | { |
44 | - if (! app(Section::class)->isFront()) { |
|
44 | + if (!app(Section::class)->isFront()) { |
|
45 | 45 | return false; |
46 | 46 | } |
47 | 47 |