GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

CLImateHandler   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 38
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A out() 0 4 1
A in() 0 5 2
1
<?php
2
namespace Dbtlr\PHPEnvBuilder\IOHandler;
3
4
use League\CLImate\CLImate;
5
6
class CLImateHandler implements IOHandlerInterface
7
{
8
    /** @var CLImate */
9
    protected $climate;
10
11
    /**
12
     * CLImateHandler constructor.
13
     *
14
     * @param CLImate $climate
15
     */
16 40
    public function __construct(CLImate $climate)
17
    {
18 40
        $this->climate = $climate;
19 40
    }
20
21
    /**
22
     * Output a message to the console.
23
     *
24
     * @param string $message
25
     */
26 2
    public function out(string $message)
27
    {
28 2
        $this->climate->out($message);
29 2
    }
30
31
    /**
32
     * Get input from the console.
33
     *
34
     * @param string $question
35
     * @param string $default
36
     * @return mixed
37
     */
38 4
    public function in(string $question, string $default = '')
39
    {
40 4
        $input = $this->climate->input($question);
41 4
        return $input->prompt() ?: $default;
42
    }
43
}
44