Skip to content

Commit 6a5be46

Browse files
committed
MCLOUD-13149: Add support of php 8.4 to cloud-patches
1 parent 9e2696a commit 6a5be46

File tree

7 files changed

+29
-13
lines changed

7 files changed

+29
-13
lines changed

composer.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
"require": {
1414
"php": "^8.0",
1515
"ext-json": "*",
16-
"composer/composer": "^1.9 || ^2.0",
16+
"composer/composer": "^1.9 || ^2.8 || !=2.2.16",
1717
"composer/semver": "@stable",
18-
"monolog/monolog": "^1.25||^2.3||^2.7|| ^3.6",
19-
"symfony/config": "^3.3||^4.4||^5.0||^6.0",
20-
"symfony/console": "^2.8 || ^4.0 || ^5.1 || ^5.4 || ^6.4",
21-
"symfony/dependency-injection": "^3.3||^4.3||^5.0||^6.0",
22-
"symfony/process": "^2.1 || ^4.1 || ^5.1 || ^5.4 || ^6.4",
18+
"monolog/monolog": "^2.3 || ^2.7 || ^3.6",
19+
"symfony/config": "^4.4 || ^5.1 || ^5.4 || ^6.4",
20+
"symfony/console": "^4.4 || ^5.1 || ^5.4 || ^6.4",
21+
"symfony/dependency-injection": "^4.4 || ^5.1 || ^5.4 || ^6.4",
22+
"symfony/process": "^4.4 || ^5.1 || ^5.4 || ^6.4",
2323
"symfony/proxy-manager-bridge": "^3.3||^4.3||^5.0||^6.0",
24-
"symfony/yaml": "^3.3||^4.0||^5.0||^6.0||^7.0",
24+
"symfony/yaml": "^4.4 || ^5.1 || ^5.4 || ^6.4",
2525
"magento/quality-patches": "^1.1.0"
2626
},
2727
"require-dev": {
@@ -32,7 +32,7 @@
3232
"codeception/module-rest": "^1.2 || ^3.0",
3333
"consolidation/robo": "^1.2 || ^3.0 || ^5.0",
3434
"phpmd/phpmd": "@stable",
35-
"phpunit/phpunit": "^8.5 || ^9.5",
35+
"phpunit/phpunit": "^9.5.10 || ^10",
3636
"squizlabs/php_codesniffer": "^3.0"
3737
},
3838
"bin": [

src/App/GenericException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class GenericException extends \Exception
1919
* @param int $code
2020
* @param Throwable|null $previous
2121
*/
22-
public function __construct(string $message, int $code = 0, Throwable $previous = null)
22+
public function __construct(string $message ="", int $code = 0, ?Throwable $previous = null)
2323
{
2424
parent::__construct($message, $code, $previous);
2525
}

src/Console/QuestionFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class QuestionFactory
2222
*
2323
* @return Question
2424
*/
25-
public function create(string $question, string $default = null): Question
25+
public function create(string $question, ?string $default = null): Question
2626
{
2727
return new Question($question, $default);
2828
}

src/Patch/Data/Patch.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,14 @@ public function getId(): string
148148
return $this->id;
149149
}
150150

151+
/**
152+
* @inheritDoc
153+
*/
154+
public function setId(): string
155+
{
156+
return $this->id;
157+
}
158+
151159
/**
152160
* @inheritDoc
153161
*/

src/Shell/ProcessFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __construct(DirectoryList $directoryList, Composer $composer)
4949
* @return Process
5050
* @throws PackageNotFoundException
5151
*/
52-
public function create(array $cmd, string $input = null): Process
52+
public function create(array $cmd, ?string $input = null): Process
5353
{
5454
return new Process(
5555
$this->processSupportsArrayParam() ? $cmd : implode(' ', $cmd),

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,19 @@ class RevertActionTest extends TestCase
5656
* @var RevertValidator|MockObject
5757
*/
5858
private $revertValidator;
59+
60+
/**
61+
* @var revertAction|MockObject
62+
*/
63+
protected $revertAction;
5964

6065
/**
6166
* @inheritdoc
6267
*/
6368
protected function setUp(): void
6469
{
70+
// Initialize the $revertAction property
71+
$this->revertAction = $this->createMock(RevertAction::class);
6572
$this->applier = $this->createMock(Applier::class);
6673
$this->revertValidator = $this->createMock(RevertValidator::class);
6774
$this->statusPool = $this->createMock(StatusPool::class);

src/Test/Unit/Shell/Command/PatchDriverTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@ class PatchDriverTest extends TestCase
3636
*/
3737
protected function setUp(): void
3838
{
39+
parent::setUp();
3940
$this->baseDir = dirname(__DIR__, 5) . '/tests/unit/';
4041
$this->cwd = $this->baseDir . 'var/';
4142
$processFactory = $this->createMock(ProcessFactory::class);
4243
$processFactory->method('create')
4344
->willReturnCallback(
44-
function (array $cmd, string $input = null) {
45+
function (array $cmd, ?string $input = null) {
4546
return new Process(
4647
$cmd,
4748
$this->cwd,
@@ -179,7 +180,7 @@ private function getFileContent(string $path): string
179180
* @param string $path
180181
* @param string|null $name
181182
*/
182-
private function copyFileToWorkingDir(string $path, string $name = null)
183+
private function copyFileToWorkingDir(string $path, ?string $name = null)
183184
{
184185
$name = $name ?? basename($path);
185186
copy($path, $this->getVarFile($name));

0 commit comments

Comments
 (0)