Symfony\Upgrade\Fixer\FormTypeNamesFixer::fix PHP Method

fix() public method

public fix ( SplFileInfo $file, $content )
$file SplFileInfo
    public function fix(\SplFileInfo $file, $content)
    {
        $tokens = Tokens::fromCode($content);
        if ($this->isFormType($tokens)) {
            foreach ($this->types as $type) {
                if (null === $this->matchTypeName($tokens, $type)) {
                    continue;
                }
                if (PHP_VERSION_ID < 50500) {
                    $this->fixTypeNamesLegacy($tokens, $type);
                } else {
                    $this->addTypeUse($tokens, $type);
                    $this->fixTypeNames($tokens, $type);
                }
            }
        }
        return $tokens->generateCode();
    }