Completed
Pull Request — master (#38)
by Wachter
23:47
created

NotSupportedException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 46
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A getProperty() 0 4 1
A getTask() 0 4 1
1
<?php
2
3
namespace Task\TaskBundle\Builder;
4
5
use Task\TaskInterface;
6
7
/**
8
 * TODO add description here
9
 */
10
class NotSupportedException extends \Exception
11
{
12
    /**
13
     * @var string
14
     */
15
    private $property;
16
17
    /**
18
     * @var TaskInterface
19
     */
20
    private $task;
21
22
    /**
23
     * @param string $property
24
     * @param TaskInterface $task
25
     */
26
    public function __construct($property, TaskInterface $task)
27
    {
28
        parent::__construct(
29
            sprintf('Property "%s" is not supported for task-class "%s".', $property, get_class($task))
30
        );
31
32
        $this->property = $property;
33
        $this->task = $task;
34
    }
35
36
    /**
37
     * Returns property.
38
     *
39
     * @return string
40
     */
41
    public function getProperty()
42
    {
43
        return $this->property;
44
    }
45
46
    /**
47
     * Returns task.
48
     *
49
     * @return TaskInterface
50
     */
51
    public function getTask()
52
    {
53
        return $this->task;
54
    }
55
}
56