1 | <?php |
||
12 | class YamlStorage implements Storage |
||
13 | { |
||
14 | /** |
||
15 | * The logs collection. |
||
16 | * |
||
17 | * @var array |
||
18 | */ |
||
19 | private $logs; |
||
20 | |||
21 | /** |
||
22 | * Constructor. |
||
23 | * |
||
24 | * @param string $yamlFile The dir path of YAML file |
||
|
|||
25 | */ |
||
26 | public function __construct($yamlFile = null) |
||
33 | |||
34 | /** |
||
35 | * {@inheritdoc} |
||
36 | */ |
||
37 | public function get($limit, $offset) |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | public function properties() |
||
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | public function size() |
||
60 | |||
61 | /** |
||
62 | * Retrieve all the logs from YAML storage. |
||
63 | * |
||
64 | * @return array |
||
65 | */ |
||
66 | private function all() |
||
78 | |||
79 | /** |
||
80 | * Paginates the given collection of logs. |
||
81 | * |
||
82 | * @param array $logs The collection logs |
||
83 | * @param int $limit Logs per page |
||
84 | * @param int $offset The number of the page |
||
85 | * |
||
86 | * @return array |
||
87 | */ |
||
88 | private function paginate($logs, $limit, $offset) |
||
92 | |||
93 | /** |
||
94 | * Compares the given two logs. |
||
95 | * |
||
96 | * @param array $log1 The first log |
||
97 | * @param array $log2 The second log |
||
98 | * |
||
99 | * @return int |
||
100 | */ |
||
101 | private function sort($log1, $log2) |
||
119 | } |
||
120 |
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.