-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFilterChain.php
More file actions
51 lines (47 loc) · 1.19 KB
/
FilterChain.php
File metadata and controls
51 lines (47 loc) · 1.19 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/*
* This file has its roots as part of the Mojavi package which was
* Copyright (c) 2003 Sean Kerr. It has been incorporated into this
* derivative work under the terms of the LGPL V2.1.
* (http://www.gnu.org/licenses/lgpl-2.1.html)
*/
namespace Xmf\Xadr;
/**
* FilterChain controls the sequence of Filter execution.
*
* @category Xmf\Xadr\FilterChain
* @package Xmf
* @author Richard Griffith <richard@geekwright.com>
* @author Sean Kerr <skerr@mojavi.org>
* @copyright 2013-2015 XOOPS Project (http://xoops.org)
* @copyright 2003 Sean Kerr
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
* @link http://xoops.org
*/
class FilterChain extends \SplQueue
{
/**
* Execute the next filter in the chain.
*
* _This method should never be called manually._
*
* @return void
*/
public function execute()
{
if ($this->count() > 0) {
$this->dequeue()->execute($this);
}
}
/**
* Register a filter.
*
* @param Filter $filter A Filter instance.
*
* @return void
*/
public function register(Filter $filter)
{
$this->enqueue($filter);
}
}