mediawiki-extensions-Cookie.../includes/ServiceWiring.php
Florian Schmidt fed15fd7a5 Refactor Hooks code and move it to separate services
This cleans up the hook file a lot and movesthe logic to seperate services
provided by MediaWikiServices. This also removes some setters and passed-
around variables and stuff. Also fixes the unit tests by not querying
external services anymore.

Change-Id: I0c3c0b7f2f5bd68aaad624e8e2dcad9bdcf97770
2018-07-18 12:59:17 +02:00

18 lines
563 B
PHP

<?php
use MediaWiki\MediaWikiServices;
return [
'CookieWarning.Config' => function ( MediaWikiServices $services ) {
return $services->getService( 'ConfigFactory' )
->makeConfig( 'cookiewarning' );
},
'GeoLocation' => function ( MediaWikiServices $services ) {
return new GeoLocation( $services->getService( 'CookieWarning.Config' ) );
},
'CookieWarning.Decisions' => function ( MediaWikiServices $services ) {
return new CookieWarningDecisions( $services->getService( 'CookieWarning.Config' ),
$services->getService( 'GeoLocation' ) );
},
];