WorkerHelper::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * Aist Queue (http://mateuszsitek.com/projects/queue)
5
 *
6
 * @copyright Copyright (c) 2017 DIGITAL WOLVES LTD (http://digitalwolves.ltd) All rights reserved.
7
 * @license   http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
8
 */
9
10
namespace Aist\Queue\Console\Helper;
11
12
use SlmQueue\Worker\WorkerInterface;
13
use Symfony\Component\Console\Helper\Helper;
14
15
/**
16
 * {@inheritdoc}
17
 */
18
class WorkerHelper extends Helper
19
{
20
    const NAME = 'workerManager';
21
22
    /** @var WorkerInterface */
23
    protected $worker;
24
25
    /**
26
     * @param WorkerInterface $worker
27
     */
28
    public function __construct(WorkerInterface $worker)
29
    {
30
        $this->worker = $worker;
31
    }
32
33
    /**
34
     * @param $method
35
     * @param $args
36
     *
37
     * @return mixed
38
     */
39
    public function __call($method, $args)
40
    {
41
        return call_user_func_array([$this->worker, $method], $args);
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function getName()
48
    {
49
        return self::NAME;
50
    }
51
}
52