File: ApiFeedContributions__feedItemHook.php

package info (click to toggle)
mediawiki 1%3A1.43.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 417,464 kB
  • sloc: php: 1,062,949; javascript: 664,290; sql: 9,714; python: 5,458; xml: 3,489; sh: 1,131; makefile: 64
file content (34 lines) | stat: -rw-r--r-- 1,324 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php

namespace MediaWiki\Api\Hook;

// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
use MediaWiki\Context\IContextSource;
use stdClass;

/**
 * This is a hook handler interface, see docs/Hooks.md.
 * Use the hook name "ApiFeedContributions::feedItem" to register handlers implementing this interface.
 *
 * @stable to implement
 * @ingroup Hooks
 */
interface ApiFeedContributions__feedItemHook {
	/**
	 * Use this hook to convert the result of ContribsPager into a MediaWiki\Feed\FeedItem instance
	 * that ApiFeedContributions can consume. Implementors of this hook may cancel
	 * the hook to signal that the item is not viewable in the provided context.
	 *
	 * @param stdClass $row A row of data from ContribsPager. The set of data returned by
	 *   ContribsPager can be adjusted by handling the ContribsPager::reallyDoQuery
	 *   hook.
	 * @param IContextSource $context
	 * @param \MediaWiki\Feed\FeedItem|null &$feedItem Set this to a FeedItem instance if the callback can handle the
	 *   provided row. This is provided to the hook as a null, if it is non-null then
	 *   another callback has already handled the hook.
	 * @return bool|void True or no return value to continue or false to abort
	 * @since 1.35
	 *
	 */
	public function onApiFeedContributions__feedItem( $row, $context, &$feedItem );
}