Conditions | 13 |
Paths | 1 |
Total Lines | 447 |
Code Lines | 263 |
Lines | 0 |
Ratio | 0 % |
Tests | 307 |
CRAP Score | 13.0443 |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
123 | public function __construct(Config $config) { |
||
124 | |||
125 | 4417 | $this->setFactory('autoloadManager', function(ServiceProvider $c) { |
|
126 | 65 | $manager = new \Elgg\AutoloadManager($c->classLoader); |
|
127 | 65 | if (!$c->config->AutoloaderManager_skip_storage) { |
|
128 | 65 | $manager->setStorage($c->fileCache); |
|
129 | 65 | $manager->loadCache(); |
|
130 | } |
||
131 | 65 | return $manager; |
|
132 | 4417 | }); |
|
133 | |||
134 | 4417 | $this->setFactory('accessCache', function(ServiceProvider $c) { |
|
1 ignored issue
–
show
|
|||
135 | 485 | return $this->sessionCache->access; |
|
136 | 4417 | }); |
|
137 | |||
138 | 4417 | $this->setFactory('accessCollections', function(ServiceProvider $c) { |
|
139 | 13 | return new \Elgg\Database\AccessCollections( |
|
140 | 13 | $c->config, |
|
141 | 13 | $c->db, |
|
142 | 13 | $c->entityTable, |
|
143 | 13 | $c->userCapabilities, |
|
144 | 13 | $c->accessCache, |
|
145 | 13 | $c->hooks, |
|
146 | 13 | $c->session, |
|
147 | 13 | $c->translator |
|
148 | ); |
||
149 | 4417 | }); |
|
150 | |||
151 | 4417 | $this->setFactory('actions', function(ServiceProvider $c) { |
|
152 | 28 | return new \Elgg\ActionsService($c->config, $c->session, $c->crypto); |
|
153 | 4417 | }); |
|
154 | |||
155 | 4417 | $this->setClassName('adminNotices', \Elgg\Database\AdminNotices::class); |
|
156 | |||
157 | 4417 | $this->setFactory('ajax', function(ServiceProvider $c) { |
|
158 | 39 | return new \Elgg\Ajax\Service($c->hooks, $c->systemMessages, $c->input, $c->amdConfig); |
|
159 | 4417 | }); |
|
160 | |||
161 | 4417 | $this->setFactory('amdConfig', function(ServiceProvider $c) { |
|
162 | 149 | $obj = new \Elgg\Amd\Config($c->hooks); |
|
163 | 149 | $obj->setBaseUrl($c->simpleCache->getRoot()); |
|
164 | 149 | return $obj; |
|
165 | 4417 | }); |
|
166 | |||
167 | 4417 | $this->setFactory('annotationsTable', function(ServiceProvider $c) { |
|
168 | 14 | return new \Elgg\Database\AnnotationsTable($c->db, $c->hooks->getEvents()); |
|
169 | 4417 | }); |
|
170 | |||
171 | 4417 | $this->setClassName('autoP', \ElggAutoP::class); |
|
172 | |||
173 | 4417 | $this->setFactory('boot', function (ServiceProvider $c) { |
|
174 | 4417 | $flags = ELGG_CACHE_PERSISTENT | ELGG_CACHE_FILESYSTEM | ELGG_CACHE_RUNTIME; |
|
175 | 4417 | $cache = new CompositeCache("elgg_boot", $c->config, $flags); |
|
176 | 4417 | $boot = new \Elgg\BootService($cache); |
|
177 | 4417 | if ($c->config->enable_profiling) { |
|
178 | $boot->setTimer($c->timer); |
||
179 | } |
||
180 | 4417 | return $boot; |
|
181 | 4417 | }); |
|
182 | |||
183 | 4417 | $this->setFactory('batchUpgrader', function(ServiceProvider $c) { |
|
184 | 1 | return new \Elgg\BatchUpgrader($c->config); |
|
185 | 4417 | }); |
|
186 | |||
187 | 4417 | $this->setFactory('cacheHandler', function(ServiceProvider $c) { |
|
188 | 1 | $simplecache_enabled = $c->config->simplecache_enabled; |
|
189 | 1 | if ($simplecache_enabled === null) { |
|
190 | $simplecache_enabled = $c->configTable->get('simplecache_enabled'); |
||
191 | } |
||
192 | 1 | return new \Elgg\Application\CacheHandler($c->config, $c->request, $simplecache_enabled); |
|
193 | 4417 | }); |
|
194 | |||
195 | 4417 | $this->setFactory('cssCompiler', function(ServiceProvider $c) { |
|
196 | 6 | return new CssCompiler($c->config, $c->hooks); |
|
197 | 4417 | }); |
|
198 | |||
199 | 4417 | $this->setFactory('classLoader', function(ServiceProvider $c) { |
|
1 ignored issue
–
show
|
|||
200 | 66 | $loader = new \Elgg\ClassLoader(new \Elgg\ClassMap()); |
|
201 | 66 | $loader->register(); |
|
202 | 66 | return $loader; |
|
203 | 4417 | }); |
|
204 | |||
205 | 4417 | $this->setFactory('cli', function(ServiceProvider $c) { |
|
206 | 1 | $version = elgg_get_version(true); |
|
207 | 1 | $console = new \Symfony\Component\Console\Application('Elgg', $version); |
|
208 | 1 | return new \Elgg\Cli($console, $c->hooks); |
|
209 | 4417 | }); |
|
210 | |||
211 | 4417 | $this->setFactory('config', function (ServiceProvider $sp) use ($config) { |
|
212 | 4417 | $this->initConfig($config, $sp); |
|
213 | 4417 | return $config; |
|
214 | 4417 | }); |
|
215 | |||
216 | 4417 | $this->setFactory('configTable', function(ServiceProvider $c) { |
|
217 | 13 | return new \Elgg\Database\ConfigTable($c->db, $c->boot, $c->logger); |
|
218 | 4417 | }); |
|
219 | |||
220 | 4417 | $this->setFactory('context', function(ServiceProvider $c) { |
|
221 | 4417 | $context = new \Elgg\Context(); |
|
222 | 4417 | $context->initialize($c->request); |
|
223 | 4417 | return $context; |
|
224 | 4417 | }); |
|
225 | |||
226 | 4417 | $this->setFactory('cron', function(ServiceProvider $c) { |
|
227 | 7 | return new Cron($c->hooks, $c->printer); |
|
228 | 4417 | }); |
|
229 | |||
230 | 4417 | $this->setClassName('crypto', \ElggCrypto::class); |
|
231 | |||
232 | 4417 | $this->setFactory('dataCache', function (ServiceProvider $c) { |
|
233 | 4417 | return new DataCache($c->config); |
|
234 | 4417 | }); |
|
235 | |||
236 | 4417 | $this->setFactory('db', function (ServiceProvider $c) { |
|
237 | 13 | $db = new \Elgg\Database($c->dbConfig); |
|
238 | 13 | $db->setLogger($c->logger); |
|
239 | |||
240 | 13 | if ($c->config->profiling_sql) { |
|
241 | $db->setTimer($c->timer); |
||
242 | } |
||
243 | |||
244 | 13 | return $db; |
|
245 | 4417 | }); |
|
246 | |||
247 | 4417 | $this->setFactory('dbConfig', function(ServiceProvider $c) { |
|
248 | $config = $c->config; |
||
249 | $db_config = \Elgg\Database\DbConfig::fromElggConfig($config); |
||
250 | |||
251 | // get this stuff out of config! |
||
252 | unset($config->db); |
||
253 | unset($config->dbname); |
||
254 | unset($config->dbhost); |
||
255 | unset($config->dbuser); |
||
256 | unset($config->dbpass); |
||
257 | |||
258 | return $db_config; |
||
259 | 4417 | }); |
|
260 | |||
261 | 4417 | $this->setFactory('deprecation', function(ServiceProvider $c) { |
|
262 | 150 | return new \Elgg\DeprecationService($c->logger); |
|
263 | 4417 | }); |
|
264 | |||
265 | 4417 | $this->setFactory('emails', function(ServiceProvider $c) { |
|
266 | 5 | return new \Elgg\EmailService($c->config, $c->hooks, $c->mailer, $c->logger); |
|
267 | 4417 | }); |
|
268 | |||
269 | 4417 | $this->setFactory('entityCache', function(ServiceProvider $c) { |
|
270 | 4417 | return new \Elgg\Cache\EntityCache($c->session, $c->sessionCache->entities); |
|
271 | 4417 | }); |
|
272 | |||
273 | 4417 | $this->setFactory('entityPreloader', function(ServiceProvider $c) { |
|
274 | 10 | return new \Elgg\EntityPreloader($c->entityTable); |
|
275 | 4417 | }); |
|
276 | |||
277 | 4417 | $this->setFactory('entityTable', function(ServiceProvider $c) { |
|
278 | 13 | return new \Elgg\Database\EntityTable( |
|
279 | 13 | $c->config, |
|
280 | 13 | $c->db, |
|
281 | 13 | $c->entityCache, |
|
282 | 13 | $c->metadataCache, |
|
283 | 13 | $c->hooks->getEvents(), |
|
284 | 13 | $c->session, |
|
285 | 13 | $c->translator, |
|
286 | 13 | $c->logger |
|
287 | ); |
||
288 | 4417 | }); |
|
289 | |||
290 | 4417 | $this->setClassName('externalFiles', \Elgg\Assets\ExternalFiles::class); |
|
291 | |||
292 | 4417 | $this->setFactory('fileCache', function(ServiceProvider $c) { |
|
293 | 4417 | $flags = ELGG_CACHE_PERSISTENT | ELGG_CACHE_FILESYSTEM | ELGG_CACHE_RUNTIME; |
|
294 | 4417 | return new CompositeCache("elgg_system_cache", $c->config, $flags); |
|
295 | 4417 | }); |
|
296 | |||
297 | 4417 | $this->setFactory('filestore', function(ServiceProvider $c) { |
|
298 | 76 | return new \ElggDiskFilestore($c->config->dataroot); |
|
299 | 4417 | }); |
|
300 | |||
301 | 4417 | $this->setFactory('forms', function(ServiceProvider $c) { |
|
302 | 12 | return new \Elgg\FormsService($c->views, $c->logger); |
|
303 | 4417 | }); |
|
304 | |||
305 | 4417 | $this->setClassName('handlers', \Elgg\HandlersService::class); |
|
306 | |||
307 | 4417 | $this->setFactory('hmac', function(ServiceProvider $c) { |
|
308 | 67 | return new \Elgg\Security\HmacFactory($c->siteSecret, $c->crypto); |
|
309 | 4417 | }); |
|
310 | |||
311 | 4417 | $this->setFactory('hooks', function(ServiceProvider $c) { |
|
312 | 4417 | $events = new \Elgg\EventsService($c->handlers); |
|
313 | 4417 | if ($c->config->enable_profiling) { |
|
314 | $events->setTimer($c->timer); |
||
315 | } |
||
316 | 4417 | return new \Elgg\PluginHooksService($events); |
|
317 | 4417 | }); |
|
318 | |||
319 | 4417 | $this->setFactory('iconService', function(ServiceProvider $c) { |
|
320 | 6 | return new \Elgg\EntityIconService($c->config, $c->hooks, $c->request, $c->logger, $c->entityTable, $c->uploads); |
|
321 | 4417 | }); |
|
322 | |||
323 | 4417 | $this->setClassName('input', \Elgg\Http\Input::class); |
|
324 | |||
325 | 4417 | $this->setFactory('imageService', function(ServiceProvider $c) { |
|
326 | 72 | switch ($c->config->image_processor) { |
|
327 | 72 | case 'imagick': |
|
328 | if (extension_loaded('imagick')) { |
||
1 ignored issue
–
show
|
|||
329 | $imagine = new \Imagine\Imagick\Imagine(); |
||
330 | break; |
||
331 | } |
||
332 | default: |
||
333 | // default use GD |
||
334 | 72 | $imagine = new \Imagine\Gd\Imagine(); |
|
335 | 72 | break; |
|
336 | } |
||
337 | |||
338 | 72 | return new \Elgg\ImageService($imagine, $c->config); |
|
339 | 4417 | }); |
|
340 | |||
341 | 4417 | $this->setFactory('logger', function (ServiceProvider $c) { |
|
342 | 4417 | $logger = new \Elgg\Logger($c->hooks, $c->context, $c->config, $c->printer); |
|
343 | 4417 | return $logger; |
|
344 | 4417 | }); |
|
345 | |||
346 | // TODO(evan): Support configurable transports... |
||
347 | 4417 | $this->setClassName('mailer', 'Zend\Mail\Transport\Sendmail'); |
|
348 | |||
349 | 4417 | $this->setFactory('menus', function(ServiceProvider $c) { |
|
350 | 3 | return new \Elgg\Menu\Service($c->hooks, $c->config); |
|
351 | 4417 | }); |
|
352 | |||
353 | 4417 | $this->setFactory('metadataCache', function (ServiceProvider $c) { |
|
354 | 4417 | $cache = $c->dataCache->metadata; |
|
355 | 4417 | return new \Elgg\Cache\MetadataCache($cache); |
|
356 | 4417 | }); |
|
357 | |||
358 | 4417 | $this->setFactory('metadataTable', function(ServiceProvider $c) { |
|
359 | // TODO(ewinslow): Use Pool instead of MetadataCache for caching |
||
360 | 13 | return new \Elgg\Database\MetadataTable($c->metadataCache, $c->db, $c->hooks->getEvents()); |
|
361 | 4417 | }); |
|
362 | |||
363 | 4417 | $this->setFactory('mutex', function(ServiceProvider $c) { |
|
364 | 2 | return new \Elgg\Database\Mutex( |
|
365 | 2 | $c->db, |
|
366 | 2 | $c->logger |
|
367 | ); |
||
368 | 4417 | }); |
|
369 | |||
370 | 4417 | $this->setFactory('notifications', function(ServiceProvider $c) { |
|
371 | // @todo move queue in service provider |
||
372 | 19 | $queue_name = \Elgg\Notifications\NotificationsService::QUEUE_NAME; |
|
373 | 19 | $queue = new \Elgg\Queue\DatabaseQueue($queue_name, $c->db); |
|
374 | 19 | $sub = new \Elgg\Notifications\SubscriptionsService($c->db); |
|
375 | 19 | return new \Elgg\Notifications\NotificationsService($sub, $queue, $c->hooks, $c->session, $c->translator, $c->entityTable, $c->logger); |
|
376 | 4417 | }); |
|
377 | |||
378 | 4417 | $this->setFactory('persistentLogin', function(ServiceProvider $c) { |
|
379 | 4417 | $global_cookies_config = $c->config->getCookieConfig(); |
|
380 | 4417 | $cookie_config = $global_cookies_config['remember_me']; |
|
381 | 4417 | $cookie_name = $cookie_config['name']; |
|
382 | 4417 | $cookie_token = $c->request->cookies->get($cookie_name, ''); |
|
383 | 4417 | return new \Elgg\PersistentLoginService( |
|
384 | 4417 | $c->db, $c->session, $c->crypto, $cookie_config, $cookie_token); |
|
385 | 4417 | }); |
|
386 | |||
387 | 4417 | $this->setClassName('passwords', \Elgg\PasswordService::class); |
|
388 | |||
389 | 4417 | $this->setFactory('plugins', function(ServiceProvider $c) { |
|
390 | 13 | $cache = new CompositeCache('plugins', $c->config, ELGG_CACHE_RUNTIME); |
|
391 | 13 | $plugins = new \Elgg\Database\Plugins($cache, $this->db); |
|
392 | 13 | if ($c->config->enable_profiling) { |
|
393 | $plugins->setTimer($c->timer); |
||
394 | } |
||
395 | 13 | return $plugins; |
|
396 | 4417 | }); |
|
397 | |||
398 | 4417 | $this->setFactory('privateSettingsCache', function(ServiceProvider $c) { |
|
399 | 33 | return $c->dataCache->private_settings; |
|
400 | 4417 | }); |
|
401 | |||
402 | 4417 | $this->setFactory('printer', function(ServiceProvider $c) { |
|
1 ignored issue
–
show
|
|||
403 | 4417 | if (php_sapi_name() === 'cli') { |
|
404 | 4417 | return new CliPrinter(); |
|
405 | } else { |
||
406 | return new ErrorLogPrinter(); |
||
407 | } |
||
408 | 4417 | }); |
|
409 | |||
410 | 4417 | $this->setFactory('privateSettings', function(ServiceProvider $c) { |
|
411 | 10 | return new \Elgg\Database\PrivateSettingsTable($c->db, $c->entityTable, $c->privateSettingsCache); |
|
412 | 4417 | }); |
|
413 | |||
414 | 4417 | $this->setFactory('publicDb', function(ServiceProvider $c) { |
|
415 | 14 | return new \Elgg\Application\Database($c->db); |
|
416 | 4417 | }); |
|
417 | |||
418 | 4417 | $this->setFactory('queryCounter', function(ServiceProvider $c) { |
|
419 | 1 | return new \Elgg\Database\QueryCounter($c->db); |
|
420 | 4417 | }, false); |
|
421 | |||
422 | 4417 | $this->setFactory('redirects', function(ServiceProvider $c) { |
|
423 | 1 | $url = current_page_url(); |
|
424 | 1 | $is_xhr = $c->request->isXmlHttpRequest(); |
|
425 | 1 | return new \Elgg\RedirectService($c->session, $is_xhr, $c->config->wwwroot, $url); |
|
426 | 4417 | }); |
|
427 | |||
428 | 4417 | $this->setFactory('relationshipsTable', function(ServiceProvider $c) { |
|
429 | 13 | return new \Elgg\Database\RelationshipsTable($c->db, $c->entityTable, $c->metadataTable, $c->hooks->getEvents()); |
|
430 | 4417 | }); |
|
431 | |||
432 | 4417 | $this->setFactory('request', [\Elgg\Http\Request::class, 'createFromGlobals']); |
|
433 | |||
434 | 4417 | $this->setFactory('requestContext', function(ServiceProvider $c) { |
|
435 | 217 | $context = new \Elgg\Router\RequestContext(); |
|
436 | 217 | $context->fromRequest($c->request); |
|
437 | 217 | return $context; |
|
438 | 4417 | }); |
|
439 | |||
440 | 4417 | $this->setFactory('responseFactory', function(ServiceProvider $c) { |
|
441 | 21 | if (php_sapi_name() === 'cli') { |
|
442 | 21 | $transport = new \Elgg\Http\OutputBufferTransport(); |
|
443 | } else { |
||
444 | $transport = new \Elgg\Http\HttpProtocolTransport(); |
||
445 | } |
||
446 | 21 | return new \Elgg\Http\ResponseFactory($c->request, $c->hooks, $c->ajax, $transport); |
|
447 | 4417 | }); |
|
448 | |||
449 | 4417 | $this->setFactory('routeCollection', function(ServiceProvider $c) { |
|
1 ignored issue
–
show
|
|||
450 | 217 | return new \Elgg\Router\RouteCollection(); |
|
451 | 4417 | }); |
|
452 | |||
453 | 4417 | $this->setFactory('router', function(ServiceProvider $c) { |
|
454 | 141 | $router = new \Elgg\Router($c->hooks, $c->routeCollection, $c->urlMatcher, $c->urlGenerator); |
|
455 | 141 | if ($c->config->enable_profiling) { |
|
456 | $router->setTimer($c->timer); |
||
457 | } |
||
458 | 141 | return $router; |
|
459 | 4417 | }); |
|
460 | |||
461 | 4417 | $this->setFactory('search', function(ServiceProvider $c) { |
|
462 | 35 | return new \Elgg\Search\SearchService($c->config, $c->hooks, $c->db); |
|
463 | 4417 | }); |
|
464 | |||
465 | 4417 | $this->setFactory('seeder', function(ServiceProvider $c) { |
|
466 | 1 | return new \Elgg\Database\Seeder($c->hooks); |
|
467 | 4417 | }); |
|
468 | |||
469 | 4417 | $this->setFactory('serveFileHandler', function(ServiceProvider $c) { |
|
470 | 10 | return new \Elgg\Application\ServeFileHandler($c->hmac, $c->config); |
|
471 | 4417 | }); |
|
472 | |||
473 | 4417 | $this->setFactory('session', function(ServiceProvider $c) { |
|
474 | return \ElggSession::fromDatabase($c->config, $c->db); |
||
475 | 4417 | }); |
|
476 | |||
477 | 4417 | $this->setFactory('sessionCache', function (ServiceProvider $c) { |
|
478 | 4417 | return new SessionCache($c->config); |
|
479 | 4417 | }); |
|
480 | |||
481 | 4417 | $this->initSiteSecret($config); |
|
482 | |||
483 | 4417 | $this->setClassName('urlSigner', \Elgg\Security\UrlSigner::class); |
|
484 | |||
485 | 4417 | $this->setFactory('simpleCache', function(ServiceProvider $c) { |
|
486 | 151 | return new \Elgg\Cache\SimpleCache($c->config); |
|
487 | 4417 | }); |
|
488 | |||
489 | 4417 | $this->setClassName('stickyForms', \Elgg\Forms\StickyForms::class); |
|
490 | |||
491 | 4417 | $this->setFactory('systemCache', function (ServiceProvider $c) { |
|
492 | 4417 | $cache = new \Elgg\Cache\SystemCache($c->fileCache, $c->config); |
|
493 | 4417 | if ($c->config->enable_profiling) { |
|
494 | $cache->setTimer($c->timer); |
||
495 | } |
||
496 | 4417 | return $cache; |
|
497 | 4417 | }); |
|
498 | |||
499 | 4417 | $this->setFactory('systemMessages', function(ServiceProvider $c) { |
|
500 | 44 | return new \Elgg\SystemMessagesService($c->session); |
|
501 | 4417 | }); |
|
502 | |||
503 | 4417 | $this->setClassName('table_columns', \Elgg\Views\TableColumn\ColumnFactory::class); |
|
504 | |||
505 | 4417 | $this->setClassName('temp_filestore', \ElggTempDiskFilestore::class); |
|
506 | |||
507 | 4417 | $this->setClassName('timer', \Elgg\Timer::class); |
|
508 | |||
509 | 4417 | $this->setFactory('translator', function(ServiceProvider $c) { |
|
510 | 4417 | return new \Elgg\I18n\Translator($c->config); |
|
511 | 4417 | }); |
|
512 | |||
513 | 4417 | $this->setFactory('uploads', function(ServiceProvider $c) { |
|
514 | 7 | return new \Elgg\UploadService($c->request, $c->imageService); |
|
515 | 4417 | }); |
|
516 | |||
517 | 4417 | $this->setFactory('upgrades', function(ServiceProvider $c) { |
|
518 | 1 | return new \Elgg\UpgradeService( |
|
519 | 1 | $c->translator, |
|
520 | 1 | $c->hooks, |
|
521 | 1 | $c->config, |
|
522 | 1 | $c->logger, |
|
523 | 1 | $c->mutex |
|
524 | ); |
||
525 | 4417 | }); |
|
526 | |||
527 | 4417 | $this->setFactory('urlGenerator', function(ServiceProvider $c) { |
|
528 | 215 | return new \Elgg\Router\UrlGenerator( |
|
529 | 215 | $c->routeCollection, |
|
530 | 215 | $c->requestContext |
|
531 | ); |
||
532 | 4417 | }); |
|
533 | |||
534 | 4417 | $this->setFactory('urlMatcher', function(ServiceProvider $c) { |
|
535 | 215 | return new \Elgg\Router\UrlMatcher( |
|
536 | 215 | $c->routeCollection, |
|
537 | 215 | $c->requestContext |
|
538 | ); |
||
539 | 4417 | }); |
|
540 | |||
541 | 4417 | $this->setFactory('userCapabilities', function(ServiceProvider $c) { |
|
542 | 498 | return new \Elgg\UserCapabilities($c->hooks, $c->entityTable, $c->session); |
|
543 | 4417 | }); |
|
544 | |||
545 | 4419 | $this->setFactory('usersTable', function(ServiceProvider $c) { |
|
546 | 4419 | return new \Elgg\Database\UsersTable( |
|
547 | 4419 | $c->config, |
|
548 | 4419 | $c->db, |
|
549 | 4419 | $c->metadataTable |
|
550 | ); |
||
551 | 4417 | }); |
|
552 | |||
553 | 4417 | $this->setFactory('upgradeLocator', function(ServiceProvider $c) { |
|
554 | 7 | return new \Elgg\Upgrade\Locator( |
|
555 | 7 | $c->plugins, |
|
556 | 7 | $c->logger, |
|
557 | 7 | $c->privateSettings |
|
558 | ); |
||
559 | 4417 | }); |
|
560 | |||
561 | 4417 | $this->setFactory('views', function(ServiceProvider $c) { |
|
562 | 664 | return new \Elgg\ViewsService($c->hooks, $c->logger, $c->input); |
|
563 | 4417 | }); |
|
564 | |||
565 | 4417 | $this->setFactory('viewCacher', function(ServiceProvider $c) { |
|
566 | 19 | return new \Elgg\Cache\ViewCacher($c->views, $c->config); |
|
567 | 4417 | }); |
|
568 | |||
569 | 4417 | $this->setClassName('widgets', \Elgg\WidgetsService::class); |
|
570 | 4417 | } |
|
683 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.