1 | <?php |
||
22 | class AppFactory implements LoggerAwareInterface { |
||
23 | |||
24 | /** |
||
25 | * @var array |
||
26 | */ |
||
27 | private $options; |
||
28 | |||
29 | /** |
||
30 | * @var Cache |
||
31 | */ |
||
32 | private $cache; |
||
33 | |||
34 | /** |
||
35 | * @var array |
||
36 | */ |
||
37 | private $connection; |
||
38 | |||
39 | /** |
||
40 | * @var LoggerInterface |
||
41 | */ |
||
42 | private $logger; |
||
43 | |||
44 | /** |
||
45 | * @var PropertyDefinitions |
||
46 | */ |
||
47 | private $propertyDefinitions; |
||
48 | |||
49 | /** |
||
50 | * @since 2.0 |
||
51 | * |
||
52 | * @param array $options |
||
53 | * @param Cache|null $cache |
||
54 | */ |
||
55 | 10 | public function __construct( array $options = [], Cache $cache = null ) { |
|
59 | |||
60 | /** |
||
61 | * @since 2.0 |
||
62 | */ |
||
63 | 2 | public function setConnection( \DatabaseBase $connection ) { |
|
66 | |||
67 | /** |
||
68 | * @since 1.3 |
||
69 | * |
||
70 | * @return DatabaseBase |
||
71 | */ |
||
72 | 2 | public function getConnection() { |
|
80 | |||
81 | /** |
||
82 | * @see LoggerAwareInterface::setLogger |
||
83 | * |
||
84 | * @since 2.0 |
||
85 | * |
||
86 | * @param LoggerInterface $logger |
||
87 | */ |
||
88 | 1 | public function setLogger( LoggerInterface $logger ) { |
|
91 | |||
92 | /** |
||
93 | * @since 2.0 |
||
94 | * |
||
95 | * @param LoggerInterface |
||
96 | */ |
||
97 | 1 | public function getLogger() { |
|
105 | |||
106 | /** |
||
107 | * @since 2.0 |
||
108 | * |
||
109 | * @param string $key |
||
110 | * @param $default $mixed |
||
111 | * |
||
112 | * @return mixed|false |
||
113 | */ |
||
114 | 2 | public function getOption( $key, $default = false ) { |
|
122 | |||
123 | /** |
||
124 | * @since 2.0 |
||
125 | * |
||
126 | * @return PropertyDefinitions |
||
127 | */ |
||
128 | 1 | public function getPropertyDefinitions() { |
|
154 | |||
155 | /** |
||
156 | * @since 1.3 |
||
157 | * |
||
158 | * @param Title $title |
||
159 | * |
||
160 | * @return WikiPage |
||
161 | */ |
||
162 | 2 | public function newWikiPage( Title $title ) { |
|
163 | |||
164 | // #55 |
||
165 | // Fight a possible DB corruption and avoid "NS_MEDIA is a virtual namespace; use NS_FILE" |
||
166 | 2 | if ( $title->getNamespace() === NS_MEDIA ) { |
|
167 | 1 | $title = Title::makeTitleSafe( |
|
168 | 1 | NS_FILE, |
|
169 | 1 | $title->getDBkey(), |
|
170 | 1 | $title->getInterwiki(), |
|
171 | 1 | $title->getFragment() |
|
172 | 1 | ); |
|
173 | 1 | } |
|
174 | |||
175 | 2 | return WikiPage::factory( $title ); |
|
176 | } |
||
177 | |||
178 | /** |
||
179 | * @since 1.3 |
||
180 | * |
||
181 | * @param Title $title |
||
182 | * |
||
183 | * @return User |
||
184 | */ |
||
185 | 1 | public function newUserFromTitle( Title $title ) { |
|
188 | |||
189 | /** |
||
190 | * @since 1.3 |
||
191 | * |
||
192 | * @param $id |
||
193 | * |
||
194 | * @return User |
||
195 | */ |
||
196 | 1 | public function newUserFromID( $id ) { |
|
199 | |||
200 | /** |
||
201 | * @since 2.0 |
||
202 | * |
||
203 | * @param null|Title $title to get the DBLogReader |
||
204 | * @param string $type which log entries to get (default: approval) |
||
205 | * @return DatabaseLogReader |
||
206 | */ |
||
207 | 1 | public function newDatabaseLogReader( Title $title = null, $type = 'approval' ) { |
|
210 | } |
||
211 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..