Completed
Push — master ( 5eaa6c...e7a27d )
by Leo
01:29
created

GearmanCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 4 1
A __construct() 0 3 1
1
<?php
2
3
namespace leocata\m1Bot\Commands;
4
5
use GetOpt\Command;
6
use leocata\M1\HttpClientAuthorization;
7
use leocata\m1Bot\Workers\GearmanWorker;
8
9
class GearmanCommand extends Command
10
{
11
12
    private $username = '';
13
    private $pass = '';
14
15
    public function __construct()
16
    {
17
        parent::__construct('gearman', [$this, 'handle']);
18
    }
19
20
    public function handle()
21
    {
22
        $auth = new HttpClientAuthorization($this->username, $this->pass);
23
        return new GearmanWorker($auth);
24
    }
25
}
26