Conditions | 3 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 19 |
Ratio | 100 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
20 | View Code Duplication | public function findDraft($user) |
|
21 | { |
||
22 | if ($user instanceof UserInterface) { |
||
23 | $user = $user->getId(); |
||
24 | } |
||
25 | |||
26 | $document = $this->findOneBy( |
||
27 | array( |
||
28 | 'isDraft' => true, |
||
29 | 'user' => $user |
||
30 | ) |
||
31 | ); |
||
32 | |||
33 | if (!empty($document)) { |
||
34 | return $document; |
||
35 | } |
||
36 | |||
37 | return null; |
||
38 | } |
||
39 | } |
||
40 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.