Skip to content

Commit e75a0a8

Browse files
committed
Add support of php 8.4 to cloud-patches
1 parent 725a46a commit e75a0a8

18 files changed

+102
-101
lines changed

src/Patch/Data/Patch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function getId(): string
152152
* Set the ID
153153
*
154154
* @return $this
155-
*/
155+
*/
156156
public function setId($id): string
157157
{
158158
$this->id = $id;

src/Test/Unit/Command/Process/Action/ApplyOptionalActionTest.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ public function testExecuteSuccessful()
108108
$outputMock = $this->getMockForAbstractClass(OutputInterface::class);
109109
$this->optionalPool->expects($this->once())
110110
->method('getList')
111-
->willReturnCallback(function($filter) use ($patchFilter, $patch1) {
112-
if ($filter === $patchFilter) {
113-
return [$patch1];
114-
}
111+
->willReturnCallback(function ($filter) use ($patchFilter, $patch1) {
112+
if ($filter === $patchFilter) {
113+
return [$patch1];
114+
}
115115
return [];
116-
})
116+
})
117117
->willReturn([$patch1, $patch2, $patch3]);
118118

119119
$this->applier->method('apply')
@@ -124,7 +124,7 @@ public function testExecuteSuccessful()
124124
]);
125125
$this->renderer->expects($this->exactly(3))
126126
->method('printPatchInfo')
127-
->willReturnCallback(function($patch, $message) use ($patch1, $patch2, $patch3) {
127+
->willReturnCallback(function ($patch, $message) use ($patch1, $patch2, $patch3) {
128128
static $callCount = 0;
129129
$expectedPatches = [$patch1, $patch2, $patch3];
130130
$expectedMessages = [
@@ -165,7 +165,7 @@ public function testApplyAlreadyAppliedPatch()
165165
$outputMock = $this->getMockForAbstractClass(OutputInterface::class);
166166
$this->optionalPool->expects($this->once())
167167
->method('getList')
168-
->willReturnCallback(function($filter) use ($patchFilter, $patch1) {
168+
->willReturnCallback(function ($filter) use ($patchFilter, $patch1) {
169169
if ($filter === $patchFilter) {
170170
return [$patch1];
171171
}
@@ -180,7 +180,6 @@ public function testApplyAlreadyAppliedPatch()
180180
$outputMock->expects($this->once())
181181
->method('writeln')
182182
->with(
183-
184183
$this->stringContains(
185184
'Patch ' . $patch1->getId() .' (' . $patch1->getFilename() . ') was already applied'
186185
)
@@ -224,7 +223,9 @@ public function testApplyingAllPatchesAndSkipDeprecated()
224223
$this->renderer->expects($this->once())
225224
->method('printPatchInfo')
226225
->with(
227-
$outputMock, $patch1, 'Patch ' . $patch1->getId() .' has been applied'
226+
$outputMock,
227+
$patch1,
228+
'Patch ' . $patch1->getId() .' has been applied'
228229
);
229230

230231
$this->action->execute($inputMock, $outputMock, $patchFilter);
@@ -261,7 +262,7 @@ public function testApplyWithException()
261262
});
262263
$this->conflictProcessor->expects($this->once())
263264
->method('process')
264-
->willReturnCallback(function($patch, $message) use ($patch1, $patch2, $patch3) {
265+
->willReturnCallback(function ($patch, $message) use ($patch1, $patch2, $patch3) {
265266
static $callCount = 0;
266267
$expectedPatches = [$patch1, $patch2, $patch3];
267268
$expectedMessages = [

src/Test/Unit/Command/Process/Action/ConfirmRequiredActionTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function testAskConfirmationForNotAppliedPatches()
9191
$outputMock = $this->createMock(OutputInterface::class);
9292
$this->optionalPool->expects($this->once())
9393
->method('getAdditionalRequiredPatches')
94-
->willReturnCallback(function($filter) use ($patchFilter, $patch1) {
94+
->willReturnCallback(function ($filter) use ($patchFilter, $patch1) {
9595
if ($filter === $patchFilter) {
9696
return [$patch1];
9797
}
@@ -108,8 +108,8 @@ public function testAskConfirmationForNotAppliedPatches()
108108
$this->renderer->expects($this->once())
109109
->method('printTable')
110110
->with($outputMock, [$aggregatedPatch])
111-
->willReturnCallback(function($output) use ($outputMock, $aggregatedPatch) {
112-
if ($output === $outputMock && $aggregatedPatch === [$aggregatedPatch] ) {
111+
->willReturnCallback(function ($output) use ($outputMock, $aggregatedPatch) {
112+
if ($output === $outputMock && $aggregatedPatch === [$aggregatedPatch]) {
113113
throw new RuntimeException('Error message');
114114
}
115115
return null;
@@ -159,7 +159,7 @@ public function testConfirmationRejected()
159159
$outputMock = $this->createMock(OutputInterface::class);
160160
$this->optionalPool->expects($this->once())
161161
->method('getAdditionalRequiredPatches')
162-
->willReturnCallback(function($filter) use ($patchFilter, $patch1) {
162+
->willReturnCallback(function ($filter) use ($patchFilter, $patch1) {
163163
if ($filter === $patchFilter) {
164164
return [$patch1];
165165
}

src/Test/Unit/Command/Process/Action/ProcessDeprecatedActionTest.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,16 @@ public function testProcessDeprecationSuccessful()
105105

106106
$this->optionalPool->expects($this->once())
107107
->method('getList')
108-
->willReturnCallback(function($filter) use ($patchFilter, $patch1) {
109-
if ($filter === $patchFilter) {
110-
return [$patch1];
111-
}
108+
->willReturnCallback(function ($filter) use ($patchFilter, $patch1) {
109+
if ($filter === $patchFilter) {
110+
return [$patch1];
111+
}
112112
return [];
113-
})
113+
})
114114
->willReturn([$patchMock]);
115115
$this->optionalPool->expects($this->once())
116116
->method('getReplacedBy')
117-
->willReturnCallback(function($patchId) use ($patchFilter, $patch1) {
117+
->willReturnCallback(function ($patchId) use ($patchFilter, $patch1) {
118118
if ($patchId === $patch1->getId()) {
119119
return [$patch1];
120120
}
@@ -128,7 +128,7 @@ public function testProcessDeprecationSuccessful()
128128

129129
$outputMock->expects($this->once())
130130
->method('writeln')
131-
->willReturnCallback(function($patchId) use ($patchFilter) {
131+
->willReturnCallback(function ($patchId) use ($patchFilter) {
132132
if ($patchId === $expectedMessage) {
133133
$this->stringContains($expectedMessage);
134134
}
@@ -157,7 +157,7 @@ public function testProcessDeprecationException()
157157

158158
$this->optionalPool->expects($this->once())
159159
->method('getList')
160-
->willReturnCallback(function($filter) use ($patchFilter, $patch1) {
160+
->willReturnCallback(function ($filter) use ($patchFilter, $patch1) {
161161
if ($filter === $patchFilter) {
162162
return [$patch1];
163163
}
@@ -204,12 +204,12 @@ public function testProcessReplacementSuccessful()
204204

205205
$this->optionalPool->expects($this->once())
206206
->method('getList')
207-
->willReturnCallback(function($filter) use ($patchFilter, $patch1) {
208-
if ($filter === $patchFilter) {
209-
return [$patch1];
210-
}
207+
->willReturnCallback(function ($filter) use ($patchFilter, $patch1) {
208+
if ($filter === $patchFilter) {
209+
return [$patch1];
210+
}
211211
return [];
212-
})
212+
})
213213
->willReturn([$patchMock]);
214214

215215
$this->aggregator->expects($this->once())
@@ -218,7 +218,7 @@ public function testProcessReplacementSuccessful()
218218

219219
$this->optionalPool->expects($this->once())
220220
->method('getReplacedBy')
221-
->willReturnCallback(function($filter) use ($patchFilter, $patch1) {
221+
->willReturnCallback(function ($filter) use ($patchFilter, $patch1) {
222222
if ($filter === $patchFilter) {
223223
return [$patch1];
224224
}
@@ -228,7 +228,7 @@ public function testProcessReplacementSuccessful()
228228

229229
$outputMock->expects($this->once())
230230
->method('writeln')
231-
->willReturnCallback(function($patchId) use ($patchFilter) {
231+
->willReturnCallback(function ($patchId) use ($patchFilter) {
232232
if ($patchId === $expectedMessage) {
233233
$this->stringContains($expectedMessage);
234234
}
@@ -263,12 +263,12 @@ public function testSkippingReplacementProcessForAppliedPatch()
263263

264264
$this->optionalPool->expects($this->once())
265265
->method('getList')
266-
->willReturnCallback(function($filter) use ($patchFilter, $patch1) {
266+
->willReturnCallback(function ($filter) use ($patchFilter, $patch1) {
267267
if ($filter === $patchFilter) {
268268
return [$patch1];
269269
}
270270
return [];
271-
})
271+
})
272272
->willReturn([$patchMock]);
273273

274274
$this->aggregator->expects($this->once())
@@ -303,7 +303,7 @@ public function testProcessReplacementException()
303303

304304
$this->optionalPool->expects($this->once())
305305
->method('getList')
306-
->willReturnCallback(function($filter) use ($patchFilter, $patch1) {
306+
->willReturnCallback(function ($filter) use ($patchFilter, $patch1) {
307307
if ($filter === $patchFilter) {
308308
return [$patch1];
309309
}
@@ -317,7 +317,7 @@ public function testProcessReplacementException()
317317

318318
$this->optionalPool->expects($this->once())
319319
->method('getReplacedBy')
320-
->willReturnCallback(function($patchId) use ($patchFilter, $patch1) {
320+
->willReturnCallback(function ($patchId) use ($patchFilter, $patch1) {
321321
if ($patchId === $patch1->getId()) {
322322
return [$patch1];
323323
}

src/Test/Unit/Command/Process/Action/RevertActionTest.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ class RevertActionTest extends TestCase
5858
private $revertValidator;
5959

6060
/**
61-
* @var revertAction|MockObject
62-
*/
61+
* @var revertAction|MockObject
62+
*/
6363
protected $revertAction;
6464

6565
/**
@@ -110,12 +110,12 @@ public function testExecuteSuccessful()
110110
$outputMock = $this->createMock(OutputInterface::class);
111111
$this->optionalPool->expects($this->once())
112112
->method('getList')
113-
->willReturnCallback(function($filter) use ($patchFilter, $patch1) {
114-
if ($filter === $patchFilter) {
115-
return [$patch1];
116-
}
113+
->willReturnCallback(function ($filter) use ($patchFilter, $patch1) {
114+
if ($filter === $patchFilter) {
115+
return [$patch1];
116+
}
117117
return [];
118-
})
118+
})
119119
->willReturn([$patch1, $patch2]);
120120

121121
$this->applier->method('revert')
@@ -126,7 +126,7 @@ public function testExecuteSuccessful()
126126

127127
$this->renderer->expects($this->exactly(2))
128128
->method('printPatchInfo')
129-
->willReturnCallback(function($patch, $message) use ($patch1, $patch2) {
129+
->willReturnCallback(function ($patch, $message) use ($patch1, $patch2) {
130130
static $callCount = 0;
131131
$expectedPatches = [$patch1, $patch2];
132132
$expectedMessages = [
@@ -140,7 +140,7 @@ public function testExecuteSuccessful()
140140
}
141141

142142
return false;
143-
});
143+
});
144144

145145
$this->action->execute($inputMock, $outputMock, $patchFilter);
146146
}
@@ -165,7 +165,7 @@ public function testRevertNotAppliedPatch()
165165
$outputMock = $this->createMock(OutputInterface::class);
166166
$this->optionalPool->expects($this->once())
167167
->method('getList')
168-
->willReturnCallback(function($filter) use ($patchFilter, $patch1) {
168+
->willReturnCallback(function ($filter) use ($patchFilter, $patch1) {
169169
if ($filter === $patchFilter) {
170170
return [$patch1];
171171
}
@@ -180,7 +180,7 @@ public function testRevertNotAppliedPatch()
180180

181181
$outputMock->expects($this->once())
182182
->method('writeln')
183-
->willReturnCallback(function($patchId) use ($patchFilter,$patch1) {
183+
->willReturnCallback(function ($patchId) use ($patchFilter, $patch1) {
184184
if ($patchId === $patch1->getId()) {
185185
$this->stringContains(
186186
'Patch ' . $patch1->getId() . ' (' . $patch1->getFilename() . ') is not applied'
@@ -214,7 +214,7 @@ public function testRevertWithException()
214214

215215
$outputMock->expects($this->once())
216216
->method('writeln')
217-
->willReturnCallback(function($patchId) use ($patchFilter) {
217+
->willReturnCallback(function ($patchId) use ($patchFilter) {
218218
if ($patchId === $errorMessage) {
219219
$this->stringContains($errorMessage);
220220
}
@@ -235,7 +235,7 @@ public function testPatchNotFoundException()
235235
$inputMock = $this->createMock(InputInterface::class);
236236
/** @var OutputInterface|MockObject $outputMock */
237237
$outputMock = $this->createMock(OutputInterface::class);
238-
$this->optionalPool->expects($this->once())
238+
$this->optionalPool->expects($this->once())
239239
->method('getList')
240240
->with($patchFilter)
241241
->willThrowException(new PatchNotFoundException(''));
@@ -256,7 +256,7 @@ public function testValidationFailedException()
256256
/** @var OutputInterface|MockObject $outputMock */
257257
$outputMock = $this->createMock(OutputInterface::class);
258258

259-
$this->revertValidator->expects($this->once())
259+
$this->revertValidator->expects($this->once())
260260
->method('validate')
261261
->with($patchFilter)
262262
->willThrowException(new RuntimeException('Error'));

src/Test/Unit/Command/Process/ApplyLocalTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function testApplySuccessful()
125125

126126
$outputMock->expects($this->exactly(4))
127127
->method('writeln')
128-
->willReturnCallback(function($patch, $message) use ($patch1, $patch2, $patch3) {
128+
->willReturnCallback(function ($patch, $message) use ($patch1, $patch2, $patch3) {
129129
static $callCount = 0;
130130
$expectedPatches = [$patch1, $patch2, $patch3];
131131
$expectedMessages = [
@@ -180,7 +180,7 @@ function ($path, $title) {
180180

181181
$this->rollbackProcessor->expects($this->once())
182182
->method('process')
183-
->willReturnCallback(function($filter) use ($patch1) {
183+
->willReturnCallback(function ($filter) use ($patch1) {
184184
if ($filter === $patch1) {
185185
return [$patch1];
186186
}

src/Test/Unit/Command/Process/ApplyOptionalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function testApplyWithPatchArgumentProvided()
8080
->with($cliPatchArgument)
8181
->willReturn($cliPatchArgument);
8282

83-
$this->actionPool->expects($this->once())
83+
$this->actionPool->expects($this->once())
8484
->method('execute')
8585
->with($inputMock, $outputMock, $cliPatchArgument);
8686
$this->applyOptional->run($inputMock, $outputMock);

src/Test/Unit/Command/Process/ApplyRequiredTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function testApplySuccessful()
103103

104104
$this->renderer->expects($this->exactly(3))
105105
->method('printPatchInfo')
106-
->willReturnCallback(function($patch, $message) use ($patch1, $patch2, $patch3) {
106+
->willReturnCallback(function ($patch, $message) use ($patch1, $patch2, $patch3) {
107107
static $callCount = 0;
108108
$expectedPatches = [$patch1, $patch2, $patch3];
109109
$expectedMessages = [
@@ -140,15 +140,15 @@ public function testApplyWithException()
140140

141141
$this->applier->method('apply')
142142
->with(
143-
$this->logicalOr($this->equalTo($patch->getPath()), $this->equalTo($patch->getId()))
143+
$this->logicalOr($this->equalTo($patch->getPath()), $this->equalTo($patch->getId()))
144144
)
145145
->willThrowException(new ApplierException('Applier error message'));
146146

147147
$this->conflictProcessor->expects($this->once())
148148
->method('process')
149149
->with(
150-
$this->logicalOr($this->equalTo($outputMock), $this->equalTo($patch), $this->equalTo([]), $this->equalTo('Applier error message'))
151-
)
150+
$this->logicalOr($this->equalTo($outputMock), $this->equalTo($patch), $this->equalTo([]), $this->equalTo('Applier error message'))
151+
)
152152
->willThrowException(new RuntimeException('Error message'));
153153

154154
$this->expectException(RuntimeException::class);

src/Test/Unit/Command/Process/Ece/ApplyOptionalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function testApplyWithPatchEnvVariableProvided()
8989
$this->actionPool->expects($this->once())
9090
->method('execute')
9191
->with($inputMock, $outputMock, $configQualityPatches)
92-
->willReturnCallback(function($input, $output, $config) use ($inputMock, $outputMock, $configQualityPatches) {
92+
->willReturnCallback(function ($input, $output, $config) use ($inputMock, $outputMock, $configQualityPatches) {
9393
if ($input === $inputMock && $output === $outputMock && $config === $configQualityPatches) {
9494
return true;
9595
}

src/Test/Unit/Command/Process/Ece/RevertTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function testRevertSuccessful()
116116

117117
$outputMock->expects($this->exactly(4))
118118
->method('writeln')
119-
->willReturnCallback(function($patch, $message) use ($patch1, $patch2) {
119+
->willReturnCallback(function ($patch, $message) use ($patch1, $patch2) {
120120
static $callCount = 0;
121121
$expectedPatches = [$patch1, $patch2, $patch3];
122122
$expectedMessages = [
@@ -135,8 +135,8 @@ public function testRevertSuccessful()
135135
$this->revertAction->expects($this->once())
136136
->method('execute')
137137
->with($inputMock, $outputMock, [])
138-
->willReturnCallback(function($input, $output) use ($inputMock, $outputMock) {
139-
if ($output === $outputMock && $input === $inputMock && $patch === [] ) {
138+
->willReturnCallback(function ($input, $output) use ($inputMock, $outputMock) {
139+
if ($output === $outputMock && $input === $inputMock && $patch === []) {
140140
return true;
141141
}
142142
return false;
@@ -183,7 +183,7 @@ function ($path, $title) {
183183
$this->revertAction->expects($this->once())
184184
->method('execute')
185185
->with($inputMock, $outputMock)
186-
->willReturnCallback(function($input, $output) use ($inputMock, $outputMock) {
186+
->willReturnCallback(function ($input, $output) use ($inputMock, $outputMock) {
187187
if ($output === $outputMock && $input === $inputMock) {
188188
return true;
189189
}

0 commit comments

Comments
 (0)