Completed
Pull Request — master (#47)
by Wachter
05:00
created

NotSupportedMethodException::getTask()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
/*
4
 * This file is part of php-task library.
5
 *
6
 * (c) php-task
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Task\TaskBundle\Builder;
13
14
use Task\TaskInterface;
15
16
/**
17
 * Indicates not supported method.
18
 */
19
class NotSupportedMethodException extends \Exception
20
{
21
    /**
22
     * @var string
23
     */
24
    private $property;
25
26
    /**
27
     * @var TaskInterface
28
     */
29
    private $task;
30
31
    /**
32
     * @param string $property
33
     * @param TaskInterface $task
34
     */
35 1
    public function __construct($property, TaskInterface $task)
36
    {
37 1
        parent::__construct(
38 1
            sprintf('Property "%s" is not supported for task-class "%s".', $property, get_class($task))
39
        );
40
41 1
        $this->property = $property;
42 1
        $this->task = $task;
43 1
    }
44
45
    /**
46
     * Returns property.
47
     *
48
     * @return string
49
     */
50
    public function getProperty()
51
    {
52
        return $this->property;
53
    }
54
55
    /**
56
     * Returns task.
57
     *
58
     * @return TaskInterface
59
     */
60
    public function getTask()
61
    {
62
        return $this->task;
63
    }
64
}
65