PhpCsFixer\Linter\ProcessLinter::createProcessForSource PHP Method

createProcessForSource() private method

Create process that lint PHP code.
private createProcessForSource ( string $source ) : Process
$source string code
return Symfony\Component\Process\Process
    private function createProcessForSource($source)
    {
        if (null === $this->temporaryFile) {
            $this->temporaryFile = tempnam('.', 'cs_fixer_tmp_');
            $this->fileRemoval->observe($this->temporaryFile);
        }
        if (false === @file_put_contents($this->temporaryFile, $source)) {
            throw new IOException(sprintf('Failed to write file "%s".', $this->temporaryFile), 0, null, $this->temporaryFile);
        }
        return $this->createProcessForFile($this->temporaryFile);
    }