PhpCsFixer\Fixer\Basic\EncodingFixer::fix PHP Метод

fix() публичный Метод

public fix ( SplFileInfo $file, Tokens $tokens )
$file SplFileInfo
$tokens PhpCsFixer\Tokenizer\Tokens
    public function fix(\SplFileInfo $file, Tokens $tokens)
    {
        $token = $tokens[0];
        $content = $token->getContent();
        if (0 === strncmp($content, $this->BOM, 3)) {
            $newContent = substr($content, 3);
            if (false === $newContent) {
                $newContent = '';
                // substr returns false rather than an empty string when starting at the end
            }
            $token->setContent($newContent);
        }
    }