99use Symfony \Component \Console \Output \OutputInterface ;
1010use Symfony \Component \Console \Style \SymfonyStyle ;
1111
12+ // phpcs:disable Generic.Files.LineLength.TooLong
1213/**
1314 * Service that orchestrates Hyvä compatibility checking across Magento modules
1415 *
1516 * This service scans modules, detects incompatibilities with Hyvä theme framework,
1617 * and provides formatted results with summary statistics.
18+ *
19+ * @phpstan-import-type ScanIssue from IncompatibilityDetector
20+ * @phpstan-import-type ScanResult from ModuleScanner
21+ * @phpstan-import-type ModuleInfo from ModuleScanner
22+ * @phpstan-type ModuleEntry array{compatible: bool, hasWarnings: bool, scanResult: ScanResult, moduleInfo: ModuleInfo}
23+ * @phpstan-type CheckSummary array{total: int, compatible: int, incompatible: int, hyvaAware: int, criticalIssues: int, warningIssues: int}
24+ * @phpstan-type CheckResults array{modules: array<string, ModuleEntry>, summary: CheckSummary, hasIncompatibilities: bool}
1725 */
26+ // phpcs:enable Generic.Files.LineLength.TooLong
1827class CompatibilityChecker
1928{
2029 /**
@@ -37,7 +46,7 @@ public function __construct(
3746 * @param bool $excludeVendor Whether to exclude modules from the vendor/ directory
3847 * @return array<string, mixed> Results with structure: ['modules' => [], 'summary' => [],
3948 * 'hasIncompatibilities' => bool]
40- * @phpstan-return array{modules: array<string, array{compatible: bool, hasWarnings: bool, scanResult: array{files: array<string, array<int, array{description: string, severity: string, line: int, pattern: string}>>, totalIssues: int, criticalIssues: int}, moduleInfo: array{name: string, version: string, isHyvaAware: bool}}>, summary: array{total: int, compatible: int, incompatible: int, hyvaAware: int, criticalIssues: int, warningIssues: int}, hasIncompatibilities: bool}
49+ * @phpstan-return CheckResults
4150 */
4251 public function check (
4352 SymfonyStyle $ io ,
@@ -140,7 +149,7 @@ private function isMagentoModule(string $moduleName): bool
140149 * Format results for display
141150 *
142151 * @param array $results
143- * @phpstan-param array{modules: array<string, array{compatible: bool, hasWarnings: bool, scanResult: array{files: array<string, array<int, array{description: string, severity: string, line: int, pattern: string}>>, totalIssues: int, criticalIssues: int}, moduleInfo: array{name: string, version: string, isHyvaAware: bool}}>} $results
152+ * @phpstan-param CheckResults $results
144153 * @param bool $showAll
145154 * @return array<int, array<int, string>>
146155 */
@@ -168,7 +177,7 @@ public function formatResultsForDisplay(array $results, bool $showAll = false):
168177 * Get status display string with colors
169178 *
170179 * @param array $moduleData
171- * @phpstan-param array{compatible: bool, hasWarnings: bool, scanResult: array<string, mixed>, moduleInfo: array<string, mixed>} $moduleData
180+ * @phpstan-param ModuleEntry $moduleData
172181 * @return string
173182 */
174183 private function getStatusDisplay (array $ moduleData ): string
@@ -192,7 +201,7 @@ private function getStatusDisplay(array $moduleData): string
192201 * Get issues display string
193202 *
194203 * @param array $moduleData
195- * @phpstan-param array{compatible: bool, hasWarnings: bool, scanResult: array{totalIssues: int, criticalIssues: int}, moduleInfo: array<string, mixed>} $moduleData
204+ * @phpstan-param ModuleEntry $moduleData
196205 * @return string
197206 */
198207 private function getIssuesDisplay (array $ moduleData ): string
@@ -223,8 +232,8 @@ private function getIssuesDisplay(array $moduleData): string
223232 *
224233 * @param string $moduleName
225234 * @param array $moduleData
226- * @phpstan-param array{compatible: bool, hasWarnings: bool, scanResult: array{files: array<string, array<int, array{description: string, severity: string, line: int, pattern: string}>>, totalIssues: int, criticalIssues: int}, moduleInfo: array{name: string, version: string, isHyvaAware: bool}} $moduleData
227- * @return array<int, array{file: string, issues: array<int, array{description: string, severity: string, line: int, pattern: string} >}>
235+ * @phpstan-param ModuleEntry $moduleData
236+ * @return array<int, array{file: string, issues: array<int, ScanIssue >}>
228237 */
229238 public function getDetailedIssues (string $ moduleName , array $ moduleData ): array
230239 {
0 commit comments