public function create(string $filePath, bool $isFixer) : File { $this->ensureFileExists($filePath); $tokens = $this->fileToTokenParser->parseFromFilePath($filePath); $eolChar = $this->eolCharDetector->detectForFilePath($filePath); return new File($filePath, $tokens, $this->fixer, $this->reportCollector, $isFixer, $eolChar); }
public function parseFromFilePath(string $filePath) : array { $fileContent = FileSystem::read($filePath); $eolChar = $this->eolCharDetector->detectForContent($fileContent); return $this->parseLegacyWithFileContentAndEolChar($fileContent, $eolChar); }