| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Hook; |
| 4 | |
| 5 | use MediaWiki\Parser\Parser; |
| 6 | use MediaWiki\Title\Title; |
| 7 | |
| 8 | /** |
| 9 | * This is a hook handler interface, see docs/Hooks.md. |
| 10 | * Use the hook name "BeforeParserFetchFileAndTitle" to register handlers implementing this interface. |
| 11 | * |
| 12 | * @stable to implement |
| 13 | * @ingroup Hooks |
| 14 | */ |
| 15 | interface BeforeParserFetchFileAndTitleHook { |
| 16 | /** |
| 17 | * This hook is called before an image is rendered by Parser. |
| 18 | * |
| 19 | * @since 1.35 |
| 20 | * |
| 21 | * @param Parser $parser |
| 22 | * @param Title $nt Image title |
| 23 | * @param array &$options Array of options to RepoGroup::findFile. If it contains 'broken' |
| 24 | * as a key then the file will appear as a broken thumbnail. |
| 25 | * If it contains `private` as a key, the value must be an Authority object. |
| 26 | * @param string &$descQuery Query string to add to thumbnail URL |
| 27 | * @return bool|void True or no return value to continue or false to abort |
| 28 | */ |
| 29 | public function onBeforeParserFetchFileAndTitle( $parser, $nt, &$options, |
| 30 | &$descQuery |
| 31 | ); |
| 32 | } |