Completed
Push — master ( 74c577...c1ce98 )
by Kirill
06:10
created

User::messages()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 4
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
declare(strict_types = 1);
3
/**
4
 * This file is part of GitterBot package.
5
 *
6
 * @author Serafim <[email protected]>
7
 * @date 23.03.2016 20:17
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
namespace Domains\User;
13
14
use Carbon\Carbon;
15
use Domains\Message\Message;
16
use Illuminate\Support\Collection;
17
18
/**
19
 * Class User
20
 * TODO This class doesnot implemented Yet
21
 *
22
 * @package Domains\User
23
 * @property string $login
24
 * @property string $name
25
 * @property Carbon $created_at
26
 * @property Carbon $updated_at
27
 * @property-read Mention[]|Collection $mentions
28
 * @property-read Message[]|Collection $messages
29
 */
30 View Code Duplication
class User extends \Eloquent
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
31
{
32
    /**
33
     * @var string
34
     */
35
    protected $table = 'users';
36
37
    /**
38
     * @return string
39
     */
40
    public function getId()
41
    {
42
        return $this->id;
43
    }
44
45
    /**
46
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
47
     */
48
    public function mentions()
49
    {
50
        return $this->hasMany(Mention::class, 'user_id', 'id');
51
    }
52
53
    /**
54
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
55
     */
56
    public function messages()
57
    {
58
        return $this->hasMany(Message::class, 'user_id', 'id');
59
    }
60
}
61