src/Command/ErrorFormatter/CheckstyleErrorFormatter.php
private function groupByFile(AnalysisResult $analysisResult): array
	{
		$files = [];

		/** @var \PHPStan\Analyser\Error $fileSpecificError */
		foreach ($analysisResult->getFileSpecificErrors() as $fileSpecificError) {
			$relativeFilePath = $this->relativePathHelper->getRelativePath(
				$fileSpecificError->getFile()
			);

			$files[$relativeFilePath][] = $fileSpecificError;
		}

		return $files;
	}
private function groupByFile(AnalysisResult $analysisResult): array
	{
		$files = [];

		/** @var \PHPStan\Analyser\Error $fileSpecificError */
		foreach ($analysisResult->getFileSpecificErrors() as $fileSpecificError) {
			$relativeFilePath = $this->relativePathHelper->getRelativePath(
				$fileSpecificError->getFile()
			);

			$files[$relativeFilePath][] = $fileSpecificError;
		}

		return $files;
	}
private function groupByFile ( AnalysisResult $ analysisResult ) : array { $ files = [ ] ; /** @var \PHPStan\Analyser\Error $fileSpecificError */ foreach ( $ analysisResult -> getFileSpecificErrors ( ) as $ fileSpecificError ) { $ relativeFilePath = $ this -> relativePathHelper -> getRelativePath ( $ fileSpecificError -> getFile ( ) ) ; $ files [ $ relativeFilePath ] [ ] = $ fileSpecificError ; } return $ files ; }
Group errors by file

@param AnalysisResult $analysisResult
@return array<string, array> Array that have as key the relative path of file
and as value an array with occured errors.
Group errors by file