Completed
Branch develop (6fd611)
by Quentin
02:32
created

InvalidGrantException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 29
rs 10
ccs 6
cts 6
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getLoginAttempt() 0 4 1
1
<?php
2
3
namespace Majora\Component\OAuth\Exception;
4
5
use Majora\Component\OAuth\Entity\LoginAttempt;
6
7
/**
8
 * Custom exception class which have to be thrown into GrantExtensions
9
 * when given LoginAttempt is invalid.
10
 */
11
class InvalidGrantException extends \InvalidArgumentException
12
{
13
    /**
14
     * @var LoginAttempt
15
     */
16
    protected $loginAttempt;
17
18
    /**
19
     * Construct.
20
     *
21
     * @param LoginAttempt $loginAttempt
22
     */
23 4
    public function __construct(LoginAttempt $loginAttempt, $message = '', $code = null, \Exception $previous = null)
24
    {
25 4
        parent::__construct($message, $code, $previous);
26
27 4
        $this->loginAttempt = $loginAttempt;
28 4
    }
29
30
    /**
31
     * Return denied LoginAttempt object.
32
     *
33
     * @return LoginAttempt
34
     */
35 2
    public function getLoginAttempt()
36
    {
37 2
        return $this->loginAttempt;
38
    }
39
}
40