Passed
Pull Request — develop (#11)
by
unknown
03:46 queued 56s
created

UserHasAlreadyAnInviteInGroupException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getGroup() 0 3 1
1
<?php
2
3
namespace App\Exceptions;
4
5
use Exception;
6
use App\Judite\Models\Group;
7
8
class UserHasAlreadyAnInviteInGroupException extends Exception
9
{
10
    /**
11
     * Group where User has already an Invite.
12
     *
13
     * @var \App\Judite\Models\Group
14
     */
15
    protected $group;
16
17
    /**
18
     * Create a new exception instance.
19
     *
20
     * @param \App\Judite\Models\Group $group
21
     * @param string                   $message
22
     */
23
    public function __construct(Group $group = null, $message = 'User already has an invite in group.')
24
    {
25
        parent::__construct($message);
26
        $this->group = $group;
27
    }
28
29
    /**
30
     * Get the group of this exception.
31
     *
32
     * @return \App\Judite\Models\Group
33
     */
34
    public function getGroup()
35
    {
36
        return $this->group;
37
    }
38
}
39