Completed
Push — master ( 014efc...9ead79 )
by Leo
02:34
created

Contact::getContacts()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
namespace leocata\M1\Methods;
4
5
use leocata\M1\Abstracts\Methods;
6
7
class Contact extends Methods
8
{
9
    public $findContact;
10
    public $inviteContact;
11
    public $contactRequested;
12
    public $contactAccept;
13
    public $contactAccepted;
14
    public $contactReject;
15
    public $contactRejected;
16
    public $deleteContact;
17
    public $updateContact;
18
    public $getContacts;
19
20
    public function getMandatoryFields(): array
21
    {
22
23
    }
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 array. 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...
24
}
25