mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-09-23 18:29:35 +00:00
Re-enable MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic sniff
Bug: T168384 Change-Id: I4d4681121df974a8471d7c4c8df8a6158f8df22a
This commit is contained in:
parent
8ea2211719
commit
c0052fcb08
|
@ -27,6 +27,11 @@ interface EventLogger {
|
|||
*/
|
||||
const PREVIEWS_SCHEMA_NAME = 'Popups';
|
||||
|
||||
/**
|
||||
* Log event
|
||||
*
|
||||
* @param array $event An associative array containing event data
|
||||
*/
|
||||
public function log( array $event );
|
||||
|
||||
}
|
||||
|
|
|
@ -31,16 +31,24 @@ class EventLoggerFactory {
|
|||
private $registry;
|
||||
|
||||
/**
|
||||
* @var \Config
|
||||
* @var Config
|
||||
*/
|
||||
private $config;
|
||||
|
||||
/**
|
||||
* EventLoggerFactory constructor
|
||||
*
|
||||
* @param Config $config MediaWiki config
|
||||
* @param ExtensionRegistry $registry MediaWiki extension registry
|
||||
*/
|
||||
public function __construct( Config $config, ExtensionRegistry $registry ) {
|
||||
$this->registry = $registry;
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the EventLogger instance
|
||||
*
|
||||
* @return EventLogger
|
||||
*/
|
||||
public function get() {
|
||||
|
|
|
@ -58,9 +58,14 @@ class MWEventLogger implements EventLogger {
|
|||
return (float)wfRandom() <= (float)$samplingRate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Log event
|
||||
*
|
||||
* @param array $event An associative array containing event data
|
||||
*/
|
||||
public function log( array $event ) {
|
||||
if ( !$this->shouldLog() ) {
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
$eventLoggingSchemas = $this->registry->getAttribute( 'EventLoggingSchemas' );
|
||||
|
||||
|
|
|
@ -22,6 +22,11 @@ namespace Popups\EventLogging;
|
|||
|
||||
class NullLogger implements EventLogger {
|
||||
|
||||
/**
|
||||
* Log event
|
||||
*
|
||||
* @param array $event An associative array containing event data
|
||||
*/
|
||||
public function log( array $event ) {
|
||||
// just do nothing
|
||||
}
|
||||
|
|
|
@ -33,6 +33,11 @@ use ResourceLoader;
|
|||
class PopupsHooks {
|
||||
const PREVIEWS_PREFERENCES_SECTION = 'rendering/reading';
|
||||
|
||||
/**
|
||||
* Hook executed on retrieving User beta preferences
|
||||
* @param User $user User whose beta preferences are retrieved
|
||||
* @param array &$prefs An associative array of all beta preferences
|
||||
*/
|
||||
static function onGetBetaPreferences( User $user, array &$prefs ) {
|
||||
global $wgExtensionAssetsPath;
|
||||
if ( PopupsContext::getInstance()->isBetaFeatureEnabled() !== true ) {
|
||||
|
@ -95,6 +100,13 @@ class PopupsHooks {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows last minute changes to the output page, e.g. adding of CSS or JavaScript by extensions.
|
||||
*
|
||||
* @param OutputPage &$out The Output page object
|
||||
* @param Skin &$skin &Skin object that will be used to generate the page
|
||||
* @return bool
|
||||
*/
|
||||
public static function onBeforePageDisplay( OutputPage &$out, Skin &$skin ) {
|
||||
$module = PopupsContext::getInstance();
|
||||
$user = $out->getUser();
|
||||
|
|
Loading…
Reference in a new issue