wiki.techinc.nl/includes/diff/Hook/DifferenceEngineNewHeaderHook.php
Tim Starling f5aaf75ad1 Automatically generated hook interfaces
Add hook interfaces which were generated by a script which parses
hooks.txt and identifies caller namespaces and directories.

Hook interfaces are mostly placed in a Hook/ subdirectory
relative to the caller location. When there are callers in multiple
directories, a "primary" caller was manually selected. The exceptions to
this are:

* The source root, maintenance and tests, which use includes/Hook. Test
  hooks need to be autoloadable in a non-test request so that
  implementing test interfaces in a generic handler will not fail.
* resources uses includes/resourceloader/Hook
* The following third-level subdirectories had their hooks placed in
  the parent ../Hook:
    * includes/filerepo/file
    * includes/search/searchwidgets
    * includes/specials/forms
    * includes/specials/helpers
    * includes/specials/pagers

Parameters marked as legacy references in hooks.txt are passed
by value in the interfaces.

Bug: T240307
Change-Id: I6efe2e7dd1f0c6a3d0f4d100a4c34e41f8428720
2020-04-20 13:31:05 +10:00

40 lines
1.8 KiB
PHP

<?php
namespace MediaWiki\Diff\Hook;
/**
* @stable for implementation
* @ingroup Hooks
*/
interface DifferenceEngineNewHeaderHook {
/**
* Allows extensions to change the $newHeader
* variable, which contains information about the new revision, such as the
* revision's author, whether the revision was marked as a minor edit or not, etc.
*
* @since 1.35
*
* @param ?mixed $differenceEngine DifferenceEngine object
* @param ?mixed &$newHeader The string containing the various #mw-diff-otitle[1-5] divs, which
* include things like revision author info, revision comment, RevisionDelete
* link and more
* @param ?mixed $formattedRevisionTools Array containing revision tools, some of which may have
* been injected with the DiffRevisionTools hook
* @param ?mixed $nextlink String containing the link to the next revision (if any); also
* included in $newHeader
* @param ?mixed $rollback Rollback link (string) to roll this revision back to the previous
* one, if any
* @param ?mixed $newminor String indicating if the new revision was marked as a minor edit
* @param ?mixed $diffOnly Boolean parameter passed to DifferenceEngine#showDiffPage, indicating
* whether we should show just the diff; passed in as a query string parameter to
* the various URLs constructed here (i.e. $nextlink)
* @param ?mixed $rdel RevisionDelete link for the new revision, if the current user is allowed
* to use the RevisionDelete feature
* @param ?mixed $unhide Boolean parameter indicating whether to show RevisionDeleted revisions
* @return bool|void True or no return value to continue or false to abort
*/
public function onDifferenceEngineNewHeader( $differenceEngine, &$newHeader,
$formattedRevisionTools, $nextlink, $rollback, $newminor, $diffOnly, $rdel,
$unhide
);
}