TaskBase   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
executeTask() 0 1 ?
help() 0 1 ?
1
<?php
2
/**
3
 * Scabbia2 Tasks Component
4
 * https://github.com/eserozvataf/scabbia2
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 *
9
 * @link        https://github.com/eserozvataf/scabbia2-tasks for the canonical source repository
10
 * @copyright   2010-2016 Eser Ozvataf. (http://eser.ozvataf.com/)
11
 * @license     http://www.apache.org/licenses/LICENSE-2.0 - Apache License, Version 2.0
12
 */
13
14
namespace Scabbia\Tasks;
15
16
use Scabbia\Formatters\FormatterInterface;
17
18
/**
19
 * Default methods needed for implementation of a task
20
 *
21
 * @package     Scabbia\Tasks
22
 * @author      Eser Ozvataf <[email protected]>
23
 * @since       2.0.0
24
 */
25
abstract class TaskBase
26
{
27
    /**
28
     * Initializes a task
29
     */
30
    public function __construct()
31
    {
32
    }
33
34
    /**
35
     * Executes the task
36
     *
37
     * @param array              $uParameters  parameters
38
     * @param FormatterInterface $uFormatter   formatter class
39
     *
40
     * @return int exit code
41
     */
42
    abstract public function executeTask(array $uParameters, FormatterInterface $uFormatter);
43
44
    /**
45
     * Returns the usage form and list of available parameters
46
     *
47
     * @param FormatterInterface $uFormatter   formatter class
48
     *
49
     * @return void
50
     */
51
    abstract public function help(FormatterInterface $uFormatter);
52
}
53