DotsUnited\BundleFu\Filter\FilterChain::filterFile PHP Method

filterFile() public method

{@inheritDoc}
public filterFile ( $content, $file, SplFileInfo $fileInfo, $bundleUrl, $bundlePath )
$fileInfo SplFileInfo
    public function filterFile($content, $file, \SplFileInfo $fileInfo, $bundleUrl, $bundlePath)
    {
        $contentFiltered = $content;
        foreach ($this->filters as $filter) {
            $contentFiltered = $filter->filterFile($contentFiltered, $file, $fileInfo, $bundleUrl, $bundlePath);
        }
        return $contentFiltered;
    }

Usage Example

Exemplo n.º 1
0
 public function testFilterReset()
 {
     $filter = new FilterChain();
     $filter->appendFilter(new StripUpperCase())->prependFilter(new LowerCase());
     $filter->resetFilters();
     $value = 'AbC';
     $valueExpected = 'AbC';
     $this->assertEquals($valueExpected, $filter->filter($value));
     $this->assertEquals($valueExpected, $filter->filterFile($value, '/js/js_1.js', new \SplFileInfo(__DIR__ . '/_files/js/js_1.js'), null, null));
 }