Completed
Push — master ( c612e7...f3e1c8 )
by Christian
06:23
created

Runner   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 33
rs 10
c 1
b 1
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A run() 0 6 1
1
<?php
2
3
/**
4
 * This file is part of tenside/core.
5
 *
6
 * (c) Christian Schiffler <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * This project is provided in good faith and hope to be usable by anyone.
12
 *
13
 * @package    tenside/core
14
 * @author     Christian Schiffler <[email protected]>
15
 * @copyright  2015 Christian Schiffler <[email protected]>
16
 * @license    https://github.com/tenside/core/blob/master/LICENSE MIT
17
 * @link       https://github.com/tenside/core
18
 * @filesource
19
 */
20
21
namespace Tenside\Core\Task;
22
23
/**
24
 * This class runs a task.
25
 */
26
class Runner
27
{
28
    /**
29
     * The task to be run.
30
     *
31
     * @var Task
32
     */
33
    private $task;
34
35
    /**
36
     * Create a new instance.
37
     *
38
     * @param Task $task The task to be run.
39
     */
40
    public function __construct(Task $task)
41
    {
42
        $this->task = $task;
43
    }
44
45
    /**
46
     * Run the task.
47
     *
48
     * @param string $logfile The log file to use.
49
     *
50
     * @return bool
51
     */
52
    public function run($logfile)
1 ignored issue
show
Coding Style introduced by
function run() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
53
    {
54
        $this->task->perform($logfile);
55
56
        return Task::STATE_FINISHED === $this->task->getStatus();
57
    }
58
}
59