mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CookieWarning
synced 2024-11-23 22:03:41 +00:00
fed15fd7a5
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
18 lines
563 B
PHP
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' ) );
|
|
},
|
|
];
|