Passed
Push — master ( a04653...8de31e )
by Vladimir
02:17
created

Channel::getWebhookUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Channels;
6
7
class Channel
8
{
9
    private $name;
10
    private $driver;
11
12 1
    public function __construct(string $name, Driver $driver)
13
    {
14 1
        $this->name = $name;
15 1
        $this->driver = $driver;
16 1
    }
17
18
    /**
19
     * Name of the channel.
20
     *
21
     * @return string
22
     */
23 1
    public function getName(): string
24
    {
25 1
        return $this->name;
26
    }
27
28
    /**
29
     * Get driver.
30
     *
31
     * @return Driver
32
     */
33 1
    public function getDriver(): Driver
34
    {
35 1
        return $this->driver;
36
    }
37
38
    /**
39
     * Get webhook URL.
40
     *
41
     * @return string
42
     */
43
    public function getWebhookUrl(): string
44
    {
45
        return route('fondbot.webhook', $this->name);
0 ignored issues
show
Documentation introduced by
$this->name is of type string, but the function expects a array.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
46
    }
47
}
48