コード例 #1
0
 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);
 }
コード例 #2
0
 public function parseFromFilePath(string $filePath) : array
 {
     $fileContent = FileSystem::read($filePath);
     $eolChar = $this->eolCharDetector->detectForContent($fileContent);
     return $this->parseLegacyWithFileContentAndEolChar($fileContent, $eolChar);
 }