public function run(Task $task)
    {
        // get configured filters for this task
        $filters = $task
            ->getConfiguration()
            ->getParameter('filters');

        // get sources files
        $sources = $this->fetchSources($task);
        $destinations = $this->fetchDestinations($task);

        foreach ($filters as $filterName) {
            // get current configured filter
            $filter = $this->getFilter($filterName);

            // filter the files supported by this filter
            $filteredSources = $this->filterSources($sources, $filter);

            // apply the filter
            $updatedSources = $filter->run($filteredSources, $destinations);

            // update new sources if exists
            if ($updatedSources === null) {
                $updatedSources = [];
            }
            $sources = $this->updateSources($sources, $filteredSources, $updatedSources);
        }

        if (!$this->isDebug) {
            foreach ($filters as $filterName) {
                // get current configured filter
                $filter = $this->getFilter($filterName);

                // clean the files generated by the filter
                $filter->clean();
            }
        }
    }
public function run(Task $task)
    {
        // get configured filters for this task
        $filters = $task
            ->getConfiguration()
            ->getParameter('filters');

        // get sources files
        $sources = $this->fetchSources($task);
        $destinations = $this->fetchDestinations($task);

        foreach ($filters as $filterName) {
            // get current configured filter
            $filter = $this->getFilter($filterName);

            // filter the files supported by this filter
            $filteredSources = $this->filterSources($sources, $filter);

            // apply the filter
            $updatedSources = $filter->run($filteredSources, $destinations);

            // update new sources if exists
            if ($updatedSources === null) {
                $updatedSources = [];
            }
            $sources = $this->updateSources($sources, $filteredSources, $updatedSources);
        }

        if (!$this->isDebug) {
            foreach ($filters as $filterName) {
                // get current configured filter
                $filter = $this->getFilter($filterName);

                // clean the files generated by the filter
                $filter->clean();
            }
        }
    }
public function run ( Task $ task ) { // get configured filters for this task $ filters = $ task -> getConfiguration ( ) -> getParameter ( 'filters' ) ; // get sources files $ sources = $ this -> fetchSources ( $ task ) ; $ destinations = $ this -> fetchDestinations ( $ task ) ; foreach ( $ filters as $ filterName ) { // get current configured filter $ filter = $ this -> getFilter ( $ filterName ) ; // filter the files supported by this filter $ filteredSources = $ this -> filterSources ( $ sources , $ filter ) ; // apply the filter $ updatedSources = $ filter -> run ( $ filteredSources , $ destinations ) ; // update new sources if exists if ( $ updatedSources === null ) { $ updatedSources = [ ] ; } $ sources = $ this -> updateSources ( $ sources , $ filteredSources , $ updatedSources ) ; } if ( ! $ this -> isDebug ) { foreach ( $ filters as $ filterName ) { // get current configured filter $ filter = $ this -> getFilter ( $ filterName ) ; // clean the files generated by the filter $ filter -> clean ( ) ; } } }
Run a task, load its sources before and call the clean method on the filter.

@param Task $task
@throws Exception
Run a task load its sources before and call the clean method on the filter .