1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace Doctrine\Tests\Mocks; |
||
6 | |||
7 | use Doctrine\DBAL\Driver\Statement; |
||
8 | |||
9 | /** |
||
10 | * This class is a mock of the Statement interface. |
||
11 | */ |
||
12 | class StatementMock implements \IteratorAggregate, Statement |
||
13 | { |
||
14 | /** |
||
15 | * {@inheritdoc} |
||
16 | */ |
||
17 | public function bindValue($param, $value, $type = null) |
||
18 | { |
||
19 | } |
||
20 | |||
21 | /** |
||
22 | * {@inheritdoc} |
||
23 | */ |
||
24 | public function bindParam($column, &$variable, $type = null, $length = null) |
||
25 | { |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * {@inheritdoc} |
||
30 | */ |
||
31 | public function errorCode() |
||
32 | { |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * {@inheritdoc} |
||
37 | */ |
||
38 | public function errorInfo() |
||
39 | { |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | public function execute($params = null) |
||
46 | { |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | public function rowCount() : int |
||
53 | { |
||
54 | } |
||
0 ignored issues
–
show
|
|||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | public function closeCursor() |
||
60 | { |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | public function columnCount() |
||
67 | { |
||
68 | } |
||
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | public function setFetchMode($fetchMode = null, ...$args) |
||
74 | { |
||
75 | } |
||
76 | |||
77 | /** |
||
78 | * {@inheritdoc} |
||
79 | */ |
||
80 | public function fetch($fetchMode = null, ...$args) |
||
81 | { |
||
82 | } |
||
83 | |||
84 | /** |
||
85 | * {@inheritdoc} |
||
86 | */ |
||
87 | public function fetchAll($fetchMode = null, ...$args) |
||
88 | { |
||
89 | } |
||
90 | |||
91 | /** |
||
92 | * {@inheritdoc} |
||
93 | */ |
||
94 | public function fetchColumn($columnIndex = 0) |
||
95 | { |
||
96 | } |
||
97 | |||
98 | /** |
||
99 | * {@inheritdoc} |
||
100 | */ |
||
101 | public function getIterator() |
||
102 | { |
||
103 | } |
||
104 | } |
||
105 |
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: