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
Pull Request — master (#11)
by TJ
02:38
created

RequiredInput   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A requiredSecret() 0 12 2
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);
0 ignored issues
show
Bug introduced by
The method secret() does not exist on Honeybadger\HoneybadgerL...\Concerns\RequiredInput. Did you maybe mean requiredSecret()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
17
18
        if (is_null($input)) {
19
            $this->error($failedMessage);
0 ignored issues
show
Bug introduced by
It seems like error() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
20
21
            return $this->requiredSecret($question, $failedMessage);
22
        }
23
24
        return $input;
25
    }
26
}
27