Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4143618
FilterMiddleware.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1001 B
Referenced Files
None
Subscribers
None
FilterMiddleware.php
View Options
<?php
namespace
MediaWiki\Notification\Middleware
;
use
MediaWiki\Notification\NotificationEnvelope
;
use
MediaWiki\Notification\NotificationMiddlewareInterface
;
use
MediaWiki\Notification\NotificationsBatch
;
/**
* Middleware that allows to filter notifications
*
* @stable to extend
* @since 1.45
*/
abstract
class
FilterMiddleware
implements
NotificationMiddlewareInterface
{
/**
* Decide whether we want to remove notification from the list
*
* Return FilterMiddlewareAction::KEEP to keep the envelope
* Return FilterMiddlewareAction::REMOVE to remove the envelope
*/
abstract
protected
function
filter
(
NotificationEnvelope
$envelope
):
FilterMiddlewareAction
;
/**
* @param NotificationsBatch $batch
* @param callable():void $next
*/
public
function
handle
(
NotificationsBatch
$batch
,
callable
$next
):
void
{
$next
();
$batch
->
filter
(
function
(
NotificationEnvelope
$envelope
)
{
return
$this
->
filter
(
$envelope
)
===
FilterMiddlewareAction
::
KEEP
;
}
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 19 2026, 16:53 (4 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d1/e3/2e3dc3c7082b08baf2e1d6c7a403
Default Alt Text
FilterMiddleware.php (1001 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment