Completed
Push — master ( 30ce68...607ba7 )
by Radu
05:54 queued 01:08
created

Command::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
namespace ParcelValue\ApiClient\Domain\Clients;
3
4
use WebServCo\Framework\Cli\Ansi;
5
use WebServCo\Framework\Cli\Sgr;
6
7
final class Command extends \ParcelValue\ApiClient\AbstractController
8
{
9
    use \ParcelValue\ApiClient\Traits\ControllerApiTrait;
10
11
    public function __construct()
12
    {
13
        parent::__construct();
14
15
        $this->repository = new Repository($this->outputLoader);
16
17
        $this->validateApiConfig();
18
    }
19
20
    public function generateAuthenticationToken()
21
    {
22
        $this->outputCli(Ansi::clear(), true);
23
        $this->outputCli(Ansi::sgr(__METHOD__, [Sgr::BOLD]), true);
24
        $this->outputCli();
0 ignored issues
show
Bug introduced by
The call to ParcelValue\ApiClient\Do...ts\Command::outputCli() has too few arguments starting with string. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

24
        $this->/** @scrutinizer ignore-call */ 
25
               outputCli();

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
25
26
        $jwt = \ParcelValue\Api\AuthenticationToken::generate($this->clientId, $this->clientKey, $this->serverKey);
27
        $this->outputCli(Ansi::sgr('Success!', [Sgr::GREEN]), false);
28
        $this->outputCli(' Your token is:', true);
29
        $this->outputCli();
30
        $this->outputCli($jwt, true);
31
        $this->outputCli();
32
        return new \WebServCo\Framework\Cli\Response('', true);
33
    }
34
}
35