Passed
Pull Request — develop (#1229)
by
unknown
02:52
created

Factory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 5
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
dl 0
loc 5
ccs 0
cts 2
cp 0
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A make() 0 3 1
1
<?php
2
3
4
namespace Longman\TelegramBot\Entities\ChatMember;
5
6
7
use Longman\TelegramBot\Entities\Entity;
8
9
class Factory extends \Longman\TelegramBot\Entities\Factory
10
{
11
    public function make(array $data, string $bot_username): Entity
12
    {
13
        var_dump($data);
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return Longman\TelegramBot\Entities\Entity. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
Security Debugging Code introduced by
var_dump($data) looks like debug code. Are you sure you do not want to remove it?
Loading history...
14
    }
15
}
16