Completed
Push — master ( 5d14d5...e5351e )
by Julien
09:39
created

Api::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 5
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 30 and the first side effect is on line 14.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
namespace App\Http\Models;
4
5
use Illuminate\Auth\Authenticatable;
6
use Illuminate\Auth\Passwords\CanResetPassword;
7
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
8
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
9
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
10
use Illuminate\Database\Eloquent\Model;
11
use Illuminate\Foundation\Auth\Access\Authorizable;
12
13
14
class Api extends Model implements
0 ignored issues
show
Bug introduced by
Possible parse error: class missing opening or closing brace
Loading history...
15
AuthenticatableContract,
16
    AuthorizableContract,
17
    CanResetPasswordContract
18
{
19
    use Authenticatable, Authorizable, CanResetPassword;
20
21
22
    protected  $user;
23
    protected  $email;
24
    protected  $password;
25
26
27
    /**
28
     * @param array $user
29
     */
30
    public  function __construct($user){
31
        $this->user = $user;
32
        $this->email = $user->email;
33
        $this->password = $user->password;
34
    }
35
36
    /**
37
     * @return array
38
     */
39
    public function getUser()
40
    {
41
        return $this->user;
42
    }
43
44
    /**
45
     * @param array $user
46
     */
47
    public function setUser($user)
48
    {
49
        $this->user = $user;
50
    }
51
52
53
54
55
56
}
57