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

TaskBuilder::setSystemKey()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
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\Builder\TaskBuilder as BaseTaskBuilder;
15
use Task\Builder\TaskBuilderInterface;
16
use Task\TaskBundle\Entity\Task;
17
18
/**
19
 * Extends base task-builder.
20
 */
21
class TaskBuilder extends BaseTaskBuilder
22
{
23
    /**
24
     * Set system-key.
25
     *
26
     * @param string $systemKey
27
     *
28
     * @return TaskBuilderInterface
29
     *
30
     * @throws NotSupportedMethodException
31
     */
32 3
    public function setSystemKey($systemKey)
33
    {
34 3
        if (!$this->task instanceof Task) {
35 1
            throw new NotSupportedMethodException('systemKey', $this->task);
36
        }
37
38 2
        $this->task->setSystemKey($systemKey);
39
40 2
        return $this;
41
    }
42
}
43