Source of file CallablesFilter.php
Size: 1,052 Bytes - Last Modified: 2013-06-02T00:13:43+02:00
/home/theseer/Downloads/Symfony/vendor/kriswallsmith/assetic/src/Assetic/Filter/CallablesFilter.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 | <?php /* * This file is part of the Assetic package, an OpenSky project. * * (c) 2010-2013 OpenSky Project Inc * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Assetic\Filter; use Assetic\Asset\AssetInterface; /** * A filter that wraps callables. * * @author Kris Wallsmith <kris.wallsmith@gmail.com> */ class CallablesFilter implements FilterInterface { private $loader; private $dumper; /** * @param callable|null $loader * @param callable|null $dumper */ public function __construct($loader = null, $dumper = null) { $this->loader = $loader; $this->dumper = $dumper; } public function filterLoad(AssetInterface $asset) { if (null !== $callable = $this->loader) { $callable($asset); } } public function filterDump(AssetInterface $asset) { if (null !== $callable = $this->dumper) { $callable($asset); } } } |