1 | <?php |
||
12 | class DatabaseLogReader { |
||
13 | |||
14 | /** |
||
15 | * @var array |
||
16 | */ |
||
17 | private static $titleCache = []; |
||
18 | |||
19 | /** |
||
20 | * @var DatabaseBase |
||
21 | */ |
||
22 | private $dbr; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $query; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | private $log; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | private $dbKey; |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | private $type; |
||
43 | |||
44 | /** |
||
45 | * @since 2.0 |
||
46 | * |
||
47 | * @param DatabaseaBase $dbr injected connection |
||
48 | * @param Title|null $title |
||
49 | * @param string $type of log (default: approval) |
||
50 | */ |
||
51 | 6 | public function __construct( $dbr, Title $title = null , $type = 'approval' ) { |
|
65 | |||
66 | /** |
||
67 | * @since 2.0 |
||
68 | */ |
||
69 | public function clearCache() { |
||
72 | 5 | ||
73 | /** |
||
74 | * Fetch the query parameters for later calls |
||
75 | * |
||
76 | * @since 2.0 |
||
77 | * |
||
78 | * @return array of parameters for SELECT call |
||
79 | */ |
||
80 | 4 | public function getQuery() { |
|
83 | |||
84 | 4 | /** |
|
85 | 2 | * @since 2.0 |
|
86 | * |
||
87 | 2 | * @return User |
|
88 | */ |
||
89 | public function getUserForLogEntry() { |
||
97 | |||
98 | 2 | /** |
|
99 | 1 | * @since 2.0 |
|
100 | * |
||
101 | 1 | * @return Timestamp |
|
102 | */ |
||
103 | public function getDateOfLogEntry() { |
||
111 | |||
112 | 2 | /** |
|
113 | 1 | * @since 2.0 |
|
114 | * |
||
115 | 1 | * @return string |
|
116 | */ |
||
117 | public function getStatusOfLogEntry() { |
||
125 | |||
126 | 4 | /** |
|
127 | 3 | * Take care of loading from the cache or filling the query. |
|
128 | */ |
||
129 | 3 | private function init() { |
|
151 | |||
152 | 3 | /** |
|
153 | * Fetch the results using our conditions |
||
154 | 3 | * |
|
155 | 3 | * @return IResultWrapper |
|
156 | 3 | * @throws DBError |
|
157 | 3 | */ |
|
158 | 3 | private function getLog() { |
|
185 | |||
186 | } |
||
187 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.