GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

RegisterController   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 62
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A validator() 0 8 1
A create() 0 8 1
1
<?php
2
3
namespace Pterodactyl\Http\Controllers\Auth;
4
5
use Validator;
6
use Pterodactyl\User;
7
use Pterodactyl\Http\Controllers\Controller;
8
use Illuminate\Foundation\Auth\RegistersUsers;
9
10
class RegisterController extends Controller
11
{
12
    /*
13
    |--------------------------------------------------------------------------
14
    | Register Controller
15
    |--------------------------------------------------------------------------
16
    |
17
    | This controller handles the registration of new users as well as their
18
    | validation and creation. By default this controller uses a trait to
19
    | provide this functionality without requiring any additional code.
20
    |
21
    */
22
23
    use RegistersUsers;
24
25
    /**
26
     * Where to redirect users after login / registration.
27
     *
28
     * @var string
29
     */
30
    protected $redirectTo = '/home';
31
32
    /**
33
     * Create a new controller instance.
34
     *
35
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
36
     */
37
    public function __construct()
38
    {
39
        $this->middleware('guest');
40
    }
41
42
    /**
43
     * Get a validator for an incoming registration request.
44
     *
45
     * @param  array  $data
46
     * @return \Illuminate\Contracts\Validation\Validator
47
     */
48
    protected function validator(array $data)
49
    {
50
        return Validator::make($data, [
51
            'name' => 'required|max:255',
52
            'email' => 'required|email|max:255|unique:users',
53
            'password' => 'required|min:6|confirmed',
54
        ]);
55
    }
56
57
    /**
58
     * Create a new user instance after a valid registration.
59
     *
60
     * @param  array  $data
61
     * @return User
62
     */
63
    protected function create(array $data)
64
    {
65
        return User::create([
66
            'name' => $data['name'],
67
            'email' => $data['email'],
68
            'password' => bcrypt($data['password']),
69
        ]);
70
    }
71
}
72