Conditions | 12 |
Paths | 1 |
Total Lines | 68 |
Code Lines | 31 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
7 | public function admineticAuth() |
||
8 | { |
||
9 | /** |
||
10 | * Register the typical authentication routes for an application. |
||
11 | * |
||
12 | * @param array $options |
||
13 | * @return callable |
||
14 | */ |
||
15 | |||
16 | return function ($options = []) { |
||
17 | $namespace = "Pratiksh\Adminetic\Http\Controllers"; |
||
18 | |||
19 | $this->group(['namespace' => $namespace], function () use ($options) { |
||
|
|||
20 | if ($options['home'] ?? true) { |
||
21 | $this->view('/', 'adminetic::welcome'); |
||
22 | } |
||
23 | // Login Routes... |
||
24 | if ($options['login'] ?? true) { |
||
25 | $this->get('login', 'Auth\LoginController@showLoginForm')->name('login'); |
||
26 | $this->post('login', 'Auth\LoginController@login'); |
||
27 | } |
||
28 | |||
29 | // Logout Routes... |
||
30 | if ($options['logout'] ?? true) { |
||
31 | $this->post('logout', 'Auth\LoginController@logout')->name('logout'); |
||
32 | } |
||
33 | |||
34 | // Registration Routes... |
||
35 | if ($options['register'] ?? true) { |
||
36 | $this->get('register', 'Auth\RegisterController@showRegistrationForm')->name('register'); |
||
37 | $this->post('register', 'Auth\RegisterController@register'); |
||
38 | } |
||
39 | |||
40 | // Password Reset Routes... |
||
41 | if ($options['reset'] ?? true) { |
||
42 | $this->resetPassword(); |
||
43 | } |
||
44 | |||
45 | // Password Confirmation Routes... |
||
46 | if ( |
||
47 | $options['confirm'] ?? |
||
48 | class_exists($this->prependGroupNamespace('Auth\ConfirmPasswordController')) |
||
49 | ) { |
||
50 | $this->confirmPassword(); |
||
51 | } |
||
52 | |||
53 | // Email Verification Routes... |
||
54 | if ($options['verify'] ?? false) { |
||
55 | $this->emailVerification(); |
||
56 | } |
||
57 | |||
58 | // Socialite Login |
||
59 | |||
60 | /* OAuth Routes */ |
||
61 | if (config('adminetic.enable_socialite', false)) { |
||
62 | if (config('adminetic.github_socialite', true)) { |
||
63 | $this->get('sign-in/github', 'Admin\SocialiteController@github')->name('sign_in_github'); |
||
64 | $this->get('sign-in/github/redirect', 'Admin\SocialiteController@githubRedirect')->name('sign_in_github_redirect'); |
||
65 | } |
||
66 | |||
67 | if (config('adminetic.facebook_socialite', true)) { |
||
68 | $this->get('sign-in/facebook', 'Admin\SocialiteController@facebook')->name('sign_in_facebook'); |
||
69 | $this->get('sign-in/facebook/redirect', 'Admin\SocialiteController@facebookRedirect')->name('sign_in_facebook_redirect'); |
||
70 | } |
||
71 | |||
72 | if (config('adminetic.google_socialite', true)) { |
||
73 | $this->get('sign-in/google', 'Admin\SocialiteController@google')->name('sign_in_google'); |
||
74 | $this->get('sign-in/google/redirect', 'Admin\SocialiteController@googleRedirect')->name('sign_in_google_redirect'); |
||
75 | } |
||
123 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.