MediaWiki
master
FilterMiddleware.php
Go to the documentation of this file.
1
<?php
2
3
namespace
MediaWiki\Notification\Middleware
;
4
5
use
MediaWiki\Notification\NotificationEnvelope
;
6
use
MediaWiki\Notification\NotificationMiddlewareInterface
;
7
use
MediaWiki\Notification\NotificationsBatch
;
8
15
abstract
class
FilterMiddleware
implements
NotificationMiddlewareInterface
{
16
23
abstract
protected
function
filter
(
NotificationEnvelope
$envelope ):
FilterMiddlewareAction
;
24
29
public
function
handle
(
NotificationsBatch
$batch, callable $next ): void {
30
$next();
31
$batch->
filter
(
function
(
NotificationEnvelope
$envelope ) {
32
return
$this->
filter
( $envelope ) === FilterMiddlewareAction::KEEP;
33
} );
34
}
35
36
}
MediaWiki\Notification\Middleware\FilterMiddleware
Middleware that allows to filter notifications.
Definition
FilterMiddleware.php:15
MediaWiki\Notification\Middleware\FilterMiddleware\filter
filter(NotificationEnvelope $envelope)
Decide whether we want to remove notification from the list.
MediaWiki\Notification\Middleware\FilterMiddleware\handle
handle(NotificationsBatch $batch, callable $next)
Definition
FilterMiddleware.php:29
MediaWiki\Notification\NotificationEnvelope
An object representing notification with list of recipients.
Definition
NotificationEnvelope.php:10
MediaWiki\Notification\NotificationsBatch
An object representing notification with list of recipients.
Definition
NotificationsBatch.php:13
MediaWiki\Notification\NotificationsBatch\filter
filter( $callback)
Definition
NotificationsBatch.php:35
MediaWiki\Notification\NotificationMiddlewareInterface
Definition
NotificationMiddlewareInterface.php:8
MediaWiki\Notification\Middleware
Definition
FilterMiddleware.php:3
MediaWiki\Notification\Middleware\FilterMiddlewareAction
FilterMiddlewareAction
Definition
FilterMiddlewareAction.php:8
includes
Notification
Middleware
FilterMiddleware.php
Generated on Thu Jul 16 2026 08:26:56 for MediaWiki by
1.10.0