Skip to content

Commit

Permalink
Add hook to set and change values
Browse files Browse the repository at this point in the history
ERM37942

[4.5.x]
  • Loading branch information
miriamschlindwein committed Jul 12, 2024
1 parent 6689afb commit 20bba2b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Hook/MWStakeCommonUILessVarsInit.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace MWStake\MediaWiki\Component\CommonUserInterface\Hook;

interface MWStakeCommonUILessVarsInit {

/**
* Set default values for LessVars
*
* @param LessVars $lessVars
* @return void
*/
public function onMWStakeCommonUILessVarsInit( $lessVars ): void;
}
14 changes: 14 additions & 0 deletions src/Hook/MWStakeCommonUILessVarsOverride.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace MWStake\MediaWiki\Component\CommonUserInterface\Hook;

interface MWStakeCommonUILessVarsOverride {

/**
* Allows to override default values
*
* @param LessVars $lessVars
* @return void
*/
public function onMWStakeCommonUILessVarsOverride( $lessVars ): void;
}
6 changes: 6 additions & 0 deletions src/LessVars.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ public static function getInstance() {
if ( static::$instance === null ) {
static::$instance = new static();
}
\MediaWiki\MediaWikiServices::getInstance()->getHookContainer()->run(
'MWStakeCommonUILessVarsInit', [ static::$instance ]
);
\MediaWiki\MediaWikiServices::getInstance()->getHookContainer()->run(
'MWStakeCommonUILessVarsOverride', [ static::$instance ]
);

return static::$instance;
}
Expand Down

0 comments on commit 20bba2b

Please sign in to comment.