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

Runner::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 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