Skip to content

Commit 6f63cb3

Browse files
authored
ACP2E-138: PHP error 'Undefined variable: errorMessage' when conflict happens during a patch applying (#43)
1 parent 723e283 commit 6f63cb3

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/Patch/Conflict/Analyzer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public function analyze(PatchInterface $failedPatch, array $patchFilter = []): s
8888
*/
8989
private function analyzeOptional(string $failedPatchId, array $patchFilter = []): string
9090
{
91+
$errorMessage = '';
9192
$optionalPatchIds = $patchFilter ?: $this->optionalPool->getIdsByType(PatchInterface::TYPE_OPTIONAL);
9293
$ids = $this->getIncompatiblePatches($optionalPatchIds, $failedPatchId);
9394
if ($ids) {

src/Test/Unit/Patch/Conflict/AnalyzerTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,14 @@ public function analyzeDataProvider(): array
143143
],
144144
'expectedMessage' => 'Patch MC-1 can\'t be applied to clean Magento instance'
145145
],
146+
[
147+
'checkApplyMap' => [
148+
[['REQUIRED-1', 'REQUIRED-2', 'MC-1'], true],
149+
[['OPTIONAL-1', 'MC-1'], true],
150+
[['OPTIONAL-2', 'MC-1'], true],
151+
],
152+
'expectedMessage' => ''
153+
],
146154
];
147155
}
148156

0 commit comments

Comments
 (0)