diff --git a/src/Features/CheckImports/CheckImportReporter.php b/src/Features/CheckImports/CheckImportReporter.php index fa201e2e..e7935bd3 100644 --- a/src/Features/CheckImports/CheckImportReporter.php +++ b/src/Features/CheckImports/CheckImportReporter.php @@ -21,17 +21,31 @@ public static function report($psr4Stats, $foldersStats, $bladeStats, int $route private static function printFileCounts($foldersStats, $bladeStats, int $countRouteFiles): string { $output = ' Overall:'."\n"; - $checkedFilesCount = ChecksOnPsr4Classes::$checkedFilesCount; - $checkedFilesCount && $output .= self::getFilesStats($checkedFilesCount); - - $bladeStats && ($output .= self::getBladeStats($bladeStats, BladeFiles::$checkedFilesCount)); - $foldersStats && ($output .= self::foldersStats($foldersStats)); - + $output .= self::compileCheckedFilesStats(); + $output .= self::compileBladeStats($bladeStats); + $output .= self::compileFolderStats($foldersStats); $output .= self::getRouteStats($countRouteFiles); return $output; } + private static function compileCheckedFilesStats(): string + { + $checkedFilesCount = ChecksOnPsr4Classes::$checkedFilesCount; + return $checkedFilesCount ? self::getFilesStats($checkedFilesCount) : ''; + } + + private static function compileBladeStats($bladeStats): string + { + return $bladeStats ? self::getBladeStats($bladeStats, BladeFiles::$checkedFilesCount) : ''; + } + + private static function compileFolderStats($foldersStats): string + { + return $foldersStats ? self::foldersStats($foldersStats) : ''; + } + + public static function printErrorsCount($errorsList) { $wrongUsedClassCount = count($errorsList['wrongClassRef'] ?? []);