1 | <?php |
||
14 | class RefsPlugin extends AbstractDatabaseCollectorPlugin |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * Returns plugin name. |
||
19 | * |
||
20 | * @return string |
||
21 | */ |
||
22 | 5 | public function getName() |
|
26 | |||
27 | /** |
||
28 | * Defines parsing statistic types. |
||
29 | * |
||
30 | * @return array |
||
31 | */ |
||
32 | 12 | public function defineStatisticTypes() |
|
36 | |||
37 | /** |
||
38 | * Processes data. |
||
39 | * |
||
40 | * @param integer $from_revision From revision. |
||
41 | * @param integer $to_revision To revision. |
||
42 | * |
||
43 | * @return void |
||
44 | */ |
||
45 | 1 | public function doProcess($from_revision, $to_revision) |
|
51 | |||
52 | /** |
||
53 | * Find revisions by collected data. |
||
54 | * |
||
55 | * @param array $criteria Criteria. |
||
56 | * @param string|null $project_path Project path. |
||
57 | * |
||
58 | * @return array |
||
59 | */ |
||
60 | 6 | public function find(array $criteria, $project_path) |
|
81 | |||
82 | /** |
||
83 | * Returns names of all refs in a project. |
||
84 | * |
||
85 | * @param integer $project_id Project ID. |
||
86 | * |
||
87 | * @return array |
||
88 | */ |
||
89 | 1 | protected function getProjectRefs($project_id) |
|
97 | |||
98 | /** |
||
99 | * Finds revisions by ref. |
||
100 | * |
||
101 | * @param integer $project_id Project ID. |
||
102 | * @param string $project_path Project path. |
||
103 | * @param array $refs Refs. |
||
104 | * |
||
105 | * @return array |
||
106 | */ |
||
107 | 2 | protected function findRevisionsByRef($project_id, $project_path, array $refs) |
|
138 | |||
139 | /** |
||
140 | * Returns information about revisions. |
||
141 | * |
||
142 | * @param array $revisions Revisions. |
||
143 | * |
||
144 | * @return array |
||
145 | */ |
||
146 | 1 | public function getRevisionsData(array $revisions) |
|
169 | |||
170 | } |
||
171 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.