MediaWiki master
FilterMiddleware.php
Go to the documentation of this file.
1<?php
2
4
8
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}
Middleware that allows to filter notifications.
filter(NotificationEnvelope $envelope)
Decide whether we want to remove notification from the list.
handle(NotificationsBatch $batch, callable $next)
An object representing notification with list of recipients.
An object representing notification with list of recipients.