Completed
Push — master ( a5a753...454108 )
by Wachter
07:05
created

NotSupportedMethodException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 63.64%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 46
ccs 7
cts 11
cp 0.6364
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
/*
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 1
        );
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