Skip to content

Commit c29779c

Browse files
committed
refactor: rename hasIncompatibilities to hasIssues in compatibility check logic
1 parent caf881a commit c29779c

4 files changed

Lines changed: 27 additions & 27 deletions

File tree

src/Console/Command/Hyva/CompatibilityCheckCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,15 +271,15 @@ private function runScan(
271271
$this->displayResults($results, $displayShowAll);
272272

273273
// Display detailed issues if requested
274-
if ($detailed && $results['hasIncompatibilities']) {
274+
if ($detailed && $results['hasIssues']) {
275275
$this->displayDetailedIssues($results);
276276
}
277277

278278
// Display summary
279279
$this->displaySummary($results['summary']);
280280

281281
// Display recommendations if there are issues
282-
if ($results['hasIncompatibilities']) {
282+
if ($results['hasIssues']) {
283283
$this->displayRecommendations();
284284
}
285285

src/Service/Hyva/CompatibilityChecker.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
* @phpstan-type CheckResults array{
3535
* modules: array<string, ModuleEntry>,
3636
* summary: CheckSummary,
37-
* hasIncompatibilities: bool
37+
* hasIssues: bool
3838
* }
3939
*/
4040
class CompatibilityChecker
@@ -57,7 +57,7 @@ public function __construct(
5757
* @param bool $thirdPartyOnly Whether to scan only third-party modules (excludes Magento_* modules)
5858
* @param bool $excludeVendor Whether to exclude modules from the vendor/ directory
5959
* @return array<string, mixed> Results with structure: ['modules' => [], 'summary' => [],
60-
* 'hasIncompatibilities' => bool]
60+
* 'hasIssues' => bool]
6161
* @phpstan-return CheckResults
6262
*/
6363
public function check(
@@ -78,7 +78,7 @@ public function check(
7878
'criticalIssues' => 0,
7979
'warningIssues' => 0,
8080
],
81-
'hasIncompatibilities' => false,
81+
'hasIssues' => false,
8282
];
8383

8484
$io->text(sprintf('Scanning %d modules for Hyvä compatibility...', count($modules)));
@@ -118,12 +118,12 @@ public function check(
118118
$results['summary']['compatible']++;
119119
} else {
120120
$results['summary']['incompatible']++;
121-
$results['hasIncompatibilities'] = true;
121+
$results['hasIssues'] = true;
122122
}
123123

124124
// Warnings alone still trigger the detail/recommendation display
125125
if ($hasWarnings) {
126-
$results['hasIncompatibilities'] = true;
126+
$results['hasIssues'] = true;
127127
}
128128

129129
if ($moduleInfo['isHyvaAware']) {

tests/Unit/Console/Command/Hyva/CompatibilityCheckCommandTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private function makeResults(array $overrides = []): array
4444
'criticalIssues' => 0,
4545
'warningIssues' => 0,
4646
],
47-
'hasIncompatibilities' => false,
47+
'hasIssues' => false,
4848
], $overrides);
4949
}
5050

@@ -77,7 +77,7 @@ public function testReturnsFailureWhenCriticalIssuesFound(): void
7777
'criticalIssues' => 2,
7878
'warningIssues' => 1,
7979
],
80-
'hasIncompatibilities' => true,
80+
'hasIssues' => true,
8181
]);
8282
$this->compatibilityChecker->method('check')->willReturn($results);
8383
$this->compatibilityChecker->method('formatResultsForDisplay')
@@ -113,7 +113,7 @@ public function testReturnsSuccessWithWarningsOnly(): void
113113
'criticalIssues' => 0,
114114
'warningIssues' => 2,
115115
],
116-
'hasIncompatibilities' => true,
116+
'hasIssues' => true,
117117
]);
118118
$this->compatibilityChecker->method('check')->willReturn($results);
119119
$this->compatibilityChecker->method('formatResultsForDisplay')
@@ -140,7 +140,7 @@ public function testDisplaySummaryRendersEachDistinctFigure(): void
140140
'criticalIssues' => 2,
141141
'warningIssues' => 5,
142142
],
143-
'hasIncompatibilities' => true,
143+
'hasIssues' => true,
144144
]);
145145
$this->compatibilityChecker->method('check')->willReturn($results);
146146
$this->compatibilityChecker->method('formatResultsForDisplay')->willReturn([]);
@@ -175,7 +175,7 @@ public function testExactlyZeroCriticalIssuesWithWarningsShowsWarningMessageNotC
175175
'criticalIssues' => 0,
176176
'warningIssues' => 3,
177177
],
178-
'hasIncompatibilities' => true,
178+
'hasIssues' => true,
179179
]);
180180
$this->compatibilityChecker->method('check')->willReturn($results);
181181
$this->compatibilityChecker->method('formatResultsForDisplay')->willReturn([]);
@@ -202,7 +202,7 @@ public function testOneCriticalIssueShowsCriticalMessageWithExactCounts(): void
202202
'criticalIssues' => 1,
203203
'warningIssues' => 0,
204204
],
205-
'hasIncompatibilities' => true,
205+
'hasIssues' => true,
206206
]);
207207
$this->compatibilityChecker->method('check')->willReturn($results);
208208
$this->compatibilityChecker->method('formatResultsForDisplay')->willReturn([]);
@@ -242,7 +242,7 @@ public function testWithoutShowAllOptionFormatResultsForDisplayReceivesFalse():
242242

243243
public function testDetailedFlagWithoutIncompatibilitiesSkipsDetailedIssues(): void
244244
{
245-
$this->compatibilityChecker->method('check')->willReturn($this->makeResults(['hasIncompatibilities' => false]));
245+
$this->compatibilityChecker->method('check')->willReturn($this->makeResults(['hasIssues' => false]));
246246
$this->compatibilityChecker->method('formatResultsForDisplay')->willReturn([]);
247247
$this->compatibilityChecker->expects($this->never())->method('getDetailedIssues');
248248

@@ -263,7 +263,7 @@ public function testIncompatibilitiesWithoutDetailedFlagSkipsDetailedIssues(): v
263263
'criticalIssues' => 1,
264264
'warningIssues' => 0,
265265
],
266-
'hasIncompatibilities' => true,
266+
'hasIssues' => true,
267267
]);
268268
$this->compatibilityChecker->method('check')->willReturn($results);
269269
$this->compatibilityChecker->method('formatResultsForDisplay')->willReturn([]);
@@ -301,7 +301,7 @@ public function testDetailedOptionDisplaysFileLevelIssues(): void
301301
'criticalIssues' => 1,
302302
'warningIssues' => 0,
303303
],
304-
'hasIncompatibilities' => true,
304+
'hasIssues' => true,
305305
]);
306306
$this->compatibilityChecker->method('check')->willReturn($results);
307307
$this->compatibilityChecker->method('formatResultsForDisplay')
@@ -350,7 +350,7 @@ public function testDetailedIssuesIncludesCompatibleModulesThatHaveWarnings(): v
350350
'criticalIssues' => 0,
351351
'warningIssues' => 1,
352352
],
353-
'hasIncompatibilities' => true,
353+
'hasIssues' => true,
354354
]);
355355
$this->compatibilityChecker->method('check')->willReturn($results);
356356
$this->compatibilityChecker->method('formatResultsForDisplay')->willReturn([]);

tests/Unit/Service/Hyva/CompatibilityCheckerTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function testAggregatesSummaryAcrossModules(): void
8080
],
8181
$results['summary'],
8282
);
83-
$this->assertTrue($results['hasIncompatibilities']);
83+
$this->assertTrue($results['hasIssues']);
8484
$this->assertTrue($results['modules']['Vendor_Clean']['compatible']);
8585
$this->assertFalse($results['modules']['Vendor_Broken']['compatible']);
8686
}
@@ -93,7 +93,7 @@ public function testCriticalIssuesAloneMarkResultsAsIncompatible(): void
9393

9494
$results = $this->checker->check($this->io);
9595

96-
$this->assertTrue($results['hasIncompatibilities']);
96+
$this->assertTrue($results['hasIssues']);
9797
$this->assertFalse($results['modules']['Vendor_Broken']['hasWarnings']);
9898
}
9999

@@ -105,7 +105,7 @@ public function testFullyCompatibleModulesProduceNoIncompatibilities(): void
105105

106106
$results = $this->checker->check($this->io);
107107

108-
$this->assertFalse($results['hasIncompatibilities']);
108+
$this->assertFalse($results['hasIssues']);
109109
$this->assertSame(0, $results['summary']['incompatible']);
110110
}
111111

@@ -117,7 +117,7 @@ public function testWarningsAloneMarkResultsAsIncompatible(): void
117117

118118
$results = $this->checker->check($this->io);
119119

120-
$this->assertTrue($results['hasIncompatibilities']);
120+
$this->assertTrue($results['hasIssues']);
121121
$this->assertTrue($results['modules']['Vendor_Warned']['compatible']);
122122
$this->assertTrue($results['modules']['Vendor_Warned']['hasWarnings']);
123123
$this->assertSame(2, $results['summary']['warningIssues']);
@@ -201,7 +201,7 @@ public function testDisplaysOnlyProblematicModulesByDefault(): void
201201
'Vendor_Clean' => $this->moduleEntry(compatible: true, hasWarnings: false, critical: 0, total: 0),
202202
'Vendor_Broken' => $this->moduleEntry(compatible: false, hasWarnings: false, critical: 2, total: 2),
203203
'Vendor_Warned' => $this->moduleEntry(compatible: true, hasWarnings: true, critical: 0, total: 1),
204-
], hasIncompatibilities: true);
204+
], hasIssues: true);
205205

206206
$tableData = $this->checker->formatResultsForDisplay($results);
207207

@@ -215,7 +215,7 @@ public function testDisplaysAllModulesWhenRequested(): void
215215
$results = $this->checkResults([
216216
'Vendor_Clean' => $this->moduleEntry(compatible: true, hasWarnings: false, critical: 0, total: 0),
217217
'Vendor_Broken' => $this->moduleEntry(compatible: false, hasWarnings: false, critical: 2, total: 2),
218-
], hasIncompatibilities: true);
218+
], hasIssues: true);
219219

220220
$tableData = $this->checker->formatResultsForDisplay($results, true);
221221

@@ -236,7 +236,7 @@ public function testFormatsMixedIssuesAndHyvaAwareStatus(): void
236236
total: 3,
237237
hyvaAware: true,
238238
),
239-
], hasIncompatibilities: true);
239+
], hasIssues: true);
240240

241241
$tableData = $this->checker->formatResultsForDisplay($results);
242242

@@ -254,7 +254,7 @@ public function testHyvaAwareCompatibleModuleGetsDedicatedStatus(): void
254254
total: 0,
255255
hyvaAware: true,
256256
),
257-
], hasIncompatibilities: false);
257+
], hasIssues: false);
258258

259259
$tableData = $this->checker->formatResultsForDisplay($results, true);
260260

@@ -333,7 +333,7 @@ private function givenModuleInfo(bool $hyvaAware): void
333333
* @param array<string, ModuleEntry> $modules
334334
* @return CheckResults
335335
*/
336-
private function checkResults(array $modules, bool $hasIncompatibilities): array
336+
private function checkResults(array $modules, bool $hasIssues): array
337337
{
338338
return [
339339
'modules' => $modules,
@@ -345,7 +345,7 @@ private function checkResults(array $modules, bool $hasIncompatibilities): array
345345
'criticalIssues' => 0,
346346
'warningIssues' => 0,
347347
],
348-
'hasIncompatibilities' => $hasIncompatibilities,
348+
'hasIssues' => $hasIssues,
349349
];
350350
}
351351

0 commit comments

Comments
 (0)