protected function processFile($filePath, $processors)
    {
        $contents = file_get_contents($filePath);

        $processed = $contents;

        foreach ($processors as $processor) {
            $processed = $this->$processor($processed);
        }

        if ($processed === $contents) {
            return;
        }

        $this->backupFile($filePath);

        file_put_contents($filePath, $processed);
    }
protected function processFile($filePath, $processors)
    {
        $contents = file_get_contents($filePath);

        $processed = $contents;

        foreach ($processors as $processor) {
            $processed = $this->$processor($processed);
        }

        if ($processed === $contents) {
            return;
        }

        $this->backupFile($filePath);

        file_put_contents($filePath, $processed);
    }
protected function processFile ( $ filePath , $ processors ) { $ contents = file_get_contents ( $ filePath ) ; $ processed = $ contents ; foreach ( $ processors as $ processor ) { $ processed = $ this -> $ processor ( $ processed ) ; } if ( $ processed === $ contents ) { return ; } $ this -> backupFile ( $ filePath ) ; file_put_contents ( $ filePath , $ processed ) ; }
Processes a given file with given processors.

@param  string $filePath   the path of the file to be processed.
@param  array  $processors array of processor function names to
be called during the file processing. Every such function shall
receive the file contents string as a parameter and return the
modified file contents.

<code>
protected function processorFunc($contents)
{
...
return $modified;
}
</code>
Processes a given file with given processors .