1 | <?php |
||
9 | class FileReader implements IFileReader |
||
10 | { |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | private $filePath; |
||
15 | |||
16 | /** |
||
17 | * @var bool |
||
18 | */ |
||
19 | private $useIncludePath; |
||
20 | |||
21 | /** |
||
22 | * @var resource |
||
23 | */ |
||
24 | private $context; |
||
25 | |||
26 | /** |
||
27 | * @var bool |
||
28 | */ |
||
29 | private $exists = false; |
||
30 | |||
31 | /** |
||
32 | * @param string $filePath |
||
33 | * @param bool $useIncludePath |
||
34 | * @param resource $context |
||
|
|||
35 | */ |
||
36 | public function __construct($filePath, $useIncludePath = false, $context = null) |
||
42 | |||
43 | /** |
||
44 | * @return string |
||
45 | */ |
||
46 | public function read() |
||
53 | |||
54 | /** |
||
55 | * @param string $data |
||
56 | * @param int $mode |
||
57 | * @return int |
||
58 | */ |
||
59 | public function write($data, $mode = 0) |
||
64 | |||
65 | /** |
||
66 | * @return bool |
||
67 | */ |
||
68 | public function isExistingFile() |
||
75 | |||
76 | /** |
||
77 | * @return bool |
||
78 | */ |
||
79 | public function isExistingDir() |
||
86 | |||
87 | /** |
||
88 | * Getter of $filePath |
||
89 | * |
||
90 | * @return string |
||
91 | */ |
||
92 | public function getFilePath() |
||
96 | |||
97 | /** |
||
98 | * @return string |
||
99 | */ |
||
100 | public function getDir() |
||
104 | |||
105 | /** |
||
106 | * Getter of $useIncludePath |
||
107 | * |
||
108 | * @return boolean |
||
109 | */ |
||
110 | public function useIncludePath() |
||
114 | |||
115 | /** |
||
116 | * Getter of $context |
||
117 | * |
||
118 | * @return resource |
||
119 | */ |
||
120 | public function getContext() |
||
124 | |||
125 | /** |
||
126 | * Setter of $filePath |
||
127 | * |
||
128 | * @param string $filePath |
||
129 | */ |
||
130 | private function setFilePath($filePath) |
||
134 | |||
135 | /** |
||
136 | * Setter of $useIncludePath |
||
137 | * |
||
138 | * @param boolean $useIncludePath |
||
139 | */ |
||
140 | private function setUseIncludePath($useIncludePath) |
||
144 | |||
145 | /** |
||
146 | * Setter of $context |
||
147 | * |
||
148 | * @param resource $context |
||
149 | */ |
||
150 | private function setContext($context) |
||
154 | |||
155 | /** |
||
156 | * |
||
157 | */ |
||
158 | private function createDir() |
||
165 | } |
||
166 | |||
167 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.