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

NotSupportedException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 2
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