1 | <?php |
||
9 | class Statistics |
||
10 | { |
||
11 | /** |
||
12 | * @var array Statistics relating to the file analysis. |
||
13 | */ |
||
14 | protected static $statistics = [ |
||
15 | 'rows_with_errors' => [], |
||
16 | 'percent_rows_with_errors' => 0, |
||
17 | 'rows_analysed' => 0 |
||
18 | ]; |
||
19 | |||
20 | |||
21 | /** |
||
22 | * Get the statistics about the file analysis. |
||
23 | * |
||
24 | * @return array The statistics. |
||
25 | */ |
||
26 | 10 | public function getStatistics() |
|
36 | |||
37 | |||
38 | /** |
||
39 | * Add the row number of a row with an error to the analysis statistics. |
||
40 | * |
||
41 | * @param int $row_number The position of the row with the error in the CSV file. |
||
|
|||
42 | * |
||
43 | * @return void |
||
44 | */ |
||
45 | 9 | public function setErrorRow($rowNumber) |
|
49 | |||
50 | |||
51 | /** |
||
52 | * Set the number of rows that have been analysed. |
||
53 | * |
||
54 | * @param int $rowsAnalysedCount The number of rows analysed. |
||
55 | * |
||
56 | * @return void |
||
57 | */ |
||
58 | 28 | public function setRowsAnalysed($rowsAnalysedCount) |
|
62 | |||
63 | |||
64 | /** |
||
65 | * Clean the rows with errors statistic. |
||
66 | * This removes duplicated records where the same row has had multiple errors. |
||
67 | * |
||
68 | * @return void |
||
69 | */ |
||
70 | 10 | private function cleanErrorRow() |
|
74 | |||
75 | |||
76 | /** |
||
77 | * Get the percentage of analysed rows that have had a error with them. |
||
78 | * |
||
79 | * @return int The percentage. |
||
80 | */ |
||
81 | 10 | private function getErrorRowPercent() |
|
85 | } |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.