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

Mention::message()   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 28.03.2016 14:25
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace Domains\User;
14
15
use Domains\Message\Message;
16
17
/**
18
 * Class Mention
19
 * @package Domains\User
20
 * @property-read User $user
21
 * @property-read Message $message
22
 */
23 View Code Duplication
class Mention 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...
24
{
25
    /**
26
     * @var bool
27
     */
28
    public $timestamps = false;
29
30
    /**
31
     * @var string
32
     */
33
    protected $table = 'mentions';
34
35
    /**
36
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
37
     */
38
    public function user()
39
    {
40
        return $this->hasOne(User::class, 'id', 'user_id');
41
    }
42
43
    /**
44
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
45
     */
46
    public function message()
47
    {
48
        return $this->belongsTo(Message::class, 'message_id', 'id');
49
    }
50
}
51