Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7422072
FilterMiddleware.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
967 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
*
* @since 1.44
* @unstable
*/
abstract
class
FilterMiddleware
implements
NotificationMiddlewareInterface
{
protected
const
KEEP
=
true
;
protected
const
REMOVE
=
false
;
/**
* Decide whether we want to remove notification from the list
*
* Return self::KEEP or true to keep the envelope
* Return self::REMOVE or false to remove the envelope
*/
abstract
protected
function
filter
(
NotificationEnvelope
$envelope
):
bool
;
/**
* @param NotificationsBatch $batch
* @param callable():void $next
*/
public
function
handle
(
NotificationsBatch
$batch
,
callable
$next
):
void
{
$next
();
$batch
->
filter
(
fn
(
NotificationEnvelope
$envelope
)
=>
$this
->
filter
(
$envelope
)
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 05:50 (5 d, 20 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
c6/4e/a6d26c8702d6dabc163605149215
Default Alt Text
FilterMiddleware.php (967 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment