<?php/*
* This file is part of the Assetic package, an OpenSky project.
*
* (c) 2010-2012 OpenSky Project Inc
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/namespaceAssetic\Filter;
useAssetic\Asset\AssetInterface;
/**
* A filter that wraps callables.
*
* @author Kris Wallsmith <kris.wallsmith@gmail.com>
*/class CallablesFilterimplements FilterInterface {
private $loader;
private $dumper;
public function__construct($loader = null, $dumper = null) {
$this->loader = $loader;
$this->dumper = $dumper;
}
public functionfilterLoad(AssetInterface $asset) {
if (null !== ($callable = $this->loader)) {
$callable($asset);
}
}
public functionfilterDump(AssetInterface $asset) {
if (null !== ($callable = $this->dumper)) {
$callable($asset);
}
}
}