1 | <?php |
||
13 | class Yaml implements IFileReader |
||
14 | { |
||
15 | /** |
||
16 | * @var IFileReader |
||
17 | */ |
||
18 | private $fileReader; |
||
19 | |||
20 | /** |
||
21 | * @var Parser |
||
22 | */ |
||
23 | private $yamlParser; |
||
24 | |||
25 | /** |
||
26 | * @var Dumper |
||
27 | */ |
||
28 | private $yamlDumper; |
||
29 | /** |
||
30 | * @var |
||
31 | */ |
||
32 | private $dumpLevel; |
||
33 | |||
34 | /** |
||
35 | * @param IFileReader $fileReader |
||
36 | * @param Parser $yamlParser |
||
37 | * @param Dumper $yamlDumper |
||
38 | * @param $dumpLevel |
||
39 | */ |
||
40 | public function __construct(IFileReader $fileReader, Parser $yamlParser, Dumper $yamlDumper, $dumpLevel = 0) |
||
47 | |||
48 | /** |
||
49 | * @return array|null |
||
|
|||
50 | */ |
||
51 | public function read() |
||
55 | |||
56 | /** |
||
57 | * @param mixed $data |
||
58 | * @param int $mode |
||
59 | * @return int |
||
60 | */ |
||
61 | public function write($data, $mode = 0) |
||
65 | } |
||
66 |
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.If the return type contains the type array, this check recommends the use of a more specific type like
String[]
orarray<String>
.