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.
Completed
Push — master ( 4ae790...236d40 )
by TJ
02:47
created

RequiredInput   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 26
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A requiredSecret() 0 12 2
secret() 0 1 ?
error() 0 1 ?
1
<?php
2
3
namespace Honeybadger\HoneybadgerLaravel\Concerns;
4
5
trait RequiredInput
6
{
7
    /**
8
     * Prompts for a required secret until its given.
9
     *
10
     * @param  string  $question
11
     * @param  string  $failedMessage
12
     * @return string
13
     */
14
    public function requiredSecret($question, $failedMessage)
15
    {
16
        $input = $this->secret($question);
17
18
        if (is_null($input)) {
19
            $this->error($failedMessage);
20
21
            return $this->requiredSecret($question, $failedMessage);
22
        }
23
24
        return $input;
25
    }
26
27
    abstract public function secret($message, $fallback = true);
28
29
    abstract public function error($message, $verbosity = null);
30
}
31