1 | <?php |
||
11 | class DatabaseLogReader { |
||
12 | |||
13 | // The parameters for our query. |
||
14 | private $query; |
||
15 | |||
16 | // The current log |
||
17 | private $log; |
||
18 | |||
19 | // Don't run multiple queries if we don't have to |
||
20 | private static $titleCache = []; |
||
21 | |||
22 | // The db connection |
||
23 | private $db; |
||
24 | |||
25 | // The title key |
||
26 | private $titlekey; |
||
27 | |||
28 | // The type of query being performed |
||
29 | private $type; |
||
30 | |||
31 | /** |
||
32 | * Constructor for reading the log. |
||
33 | * |
||
34 | * @param AppFactory $appFactory injected AppFactory |
||
|
|||
35 | * @param Title $title page |
||
36 | * @param string $type of log (default: approval) |
||
37 | */ |
||
38 | public function __construct( DatabaseBase $db, Title $title, $type = 'approval' ) { |
||
43 | |||
44 | /** |
||
45 | * Take care of loading from the cache or filling the query. |
||
46 | */ |
||
47 | private function init() { |
||
65 | |||
66 | /** |
||
67 | * Fetch the results using our conditions |
||
68 | * |
||
69 | * @return IResultWrapper |
||
70 | * @throws DBError |
||
71 | */ |
||
72 | private function getLog() { |
||
81 | |||
82 | /** |
||
83 | * Fetch the query for later calls |
||
84 | * |
||
85 | * @return array |
||
86 | */ |
||
87 | public function getQuery() { |
||
90 | |||
91 | /** |
||
92 | * Get the person who made the last for this page |
||
93 | * |
||
94 | * @return User |
||
95 | */ |
||
96 | public function getUser() { |
||
103 | |||
104 | /** |
||
105 | * Get the date of the last entry in the log for this page |
||
106 | * |
||
107 | * @return Timestamp |
||
108 | */ |
||
109 | public function getDate() { |
||
116 | |||
117 | /** |
||
118 | * Get the status of the last entry in the log for this page |
||
119 | * |
||
120 | * @return Timestamp |
||
121 | */ |
||
122 | public function getStatus() { |
||
129 | } |
||
130 |
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.