Revision 7575,
1.0 KB
checked in by angelo, 12 years ago
(diff) |
Ticket #3197 - Reduzir tempo de carregamento do modulo Expresso Mail
|
Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | /* |
---|
4 | * This file is part of the Assetic package, an OpenSky project. |
---|
5 | * |
---|
6 | * (c) 2010-2012 OpenSky Project Inc |
---|
7 | * |
---|
8 | * For the full copyright and license information, please view the LICENSE |
---|
9 | * file that was distributed with this source code. |
---|
10 | */ |
---|
11 | |
---|
12 | namespace Assetic\Filter; |
---|
13 | |
---|
14 | use Assetic\Asset\AssetInterface; |
---|
15 | |
---|
16 | /** |
---|
17 | * A filter that wraps callables. |
---|
18 | * |
---|
19 | * @author Kris Wallsmith <kris.wallsmith@gmail.com> |
---|
20 | */ |
---|
21 | class CallablesFilter implements FilterInterface |
---|
22 | { |
---|
23 | private $loader; |
---|
24 | private $dumper; |
---|
25 | |
---|
26 | /** |
---|
27 | * @param callable|null $loader |
---|
28 | * @param callable|null $dumper |
---|
29 | */ |
---|
30 | public function __construct($loader = null, $dumper = null) |
---|
31 | { |
---|
32 | $this->loader = $loader; |
---|
33 | $this->dumper = $dumper; |
---|
34 | } |
---|
35 | |
---|
36 | public function filterLoad(AssetInterface $asset) |
---|
37 | { |
---|
38 | if (null !== $callable = $this->loader) { |
---|
39 | $callable($asset); |
---|
40 | } |
---|
41 | } |
---|
42 | |
---|
43 | public function filterDump(AssetInterface $asset) |
---|
44 | { |
---|
45 | if (null !== $callable = $this->dumper) { |
---|
46 | $callable($asset); |
---|
47 | } |
---|
48 | } |
---|
49 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.