InvalidExtractorException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 4
Bugs 1 Features 3
Metric Value
c 4
b 1
f 3
dl 0
loc 35
wmc 3
lcom 0
cbo 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 2
A getExtractorClass() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Oryzone PHPoAuthUserData package <https://github.com/Oryzone/PHPoAuthUserData>.
5
 *
6
 * (c) Oryzone, developed by Luciano Mammino <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace OAuth\UserData\Exception;
13
14
/**
15
 * Class InvalidExtractorException
16
 * @package OAuth\UserData\Exception
17
 */
18
class InvalidExtractorException extends \Exception implements Exception
19
{
20
    /**
21
     * @var string $serviceName
22
     */
23
    protected $extractorClass;
24
25
    /**
26
     * Constructor
27
     *
28
     * @param string      $extractorClass
29
     * @param string|null $message
30
     */
31
    public function __construct($extractorClass, $message = null)
32
    {
33
        $this->extractorClass = $extractorClass;
34
        if (null === $message) {
35
            $message = sprintf(
36
                'The class "%s" does not implement the interface OAuth\UserData\Extractor\ExtractorInterface',
37
                $extractorClass
38
            );
39
        }
40
        parent::__construct($message);
41
    }
42
43
    /**
44
     * Get the service name
45
     *
46
     * @return string
47
     */
48
    public function getExtractorClass()
49
    {
50
        return $this->extractorClass;
51
    }
52
}
53