Completed
Push — 3.0 ( 9dd29c...237018 )
by Jeroen
53:05
created

mod/friends_collections/start.php (1 issue)

1
<?php
2
/**
3
 * Friend collections
4
 * Provides an interface for users to manage their friend collections
5
 */
6
7
use Elgg\Friends\Collections\CollectionMenuHandler;
8
use Elgg\Friends\Collections\DeleteRelationshipHandler;
9
use Elgg\Friends\Collections\EntityMenuHandler;
10
use Elgg\Friends\Collections\PageMenuHandler;
11
use Elgg\Friends\Collections\Router;
0 ignored issues
show
The type Elgg\Friends\Collections\Router was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use Elgg\Friends\Collections\UrlHandler;
13
14
/**
15
 * Friend collection init
16
 *
17
 * @return void
18
 */
19
function friends_collections_init() {
20
21
	// Setup /collections controller and collection URLs
22 34
	elgg_register_plugin_hook_handler('access_collection:url', 'access_collection', UrlHandler::class);
23
24
	// Add Collections page menu item
25 34
	elgg_register_plugin_hook_handler('register', 'menu:page', PageMenuHandler::class);
26
27
	// Setup access collection menu
28 34
	elgg_register_plugin_hook_handler('register', 'menu:friends:collection', CollectionMenuHandler::class);
29
30 34
	elgg_register_plugin_hook_handler('register', 'menu:entity', EntityMenuHandler::class);
31
32
	// Remove users from access collections when friendship is revoked
33 34
	elgg_register_event_handler('delete', 'relationship', DeleteRelationshipHandler::class);
34
35
	// Add some styling
36 34
	elgg_extend_view('elgg.css', 'collections/collections.css');
37
38 34
}
39
40
return function() {
41 37
	elgg_register_event_handler('init', 'system', 'friends_collections_init');
42
};
43