Skip to content

Commit 798b99c

Browse files
MCLOUD-13147: Added PHP8.4 fixation with PHPUnit, PHPStan & PHPMD compatibility
1 parent 6f24400 commit 798b99c

File tree

15 files changed

+111
-57
lines changed

15 files changed

+111
-57
lines changed

composer.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
"codeception/module-rest": "^1.2 || ^3.0",
2727
"consolidation/robo": "^2.0 || ^3.0",
2828
"phpmd/phpmd": "@stable",
29-
"phpstan/phpstan": "^1.8",
30-
"phpunit/phpunit": "^9.5",
31-
"squizlabs/php_codesniffer": "^3.6"
29+
"phpstan/phpstan": "^1.8 || ^2.0",
30+
"phpunit/php-code-coverage": "^10.1",
31+
"phpunit/phpunit": "^9.5 || ^10.5",
32+
"squizlabs/php_codesniffer": "^3.7"
3233
},
3334
"bin": [
3435
"bin/ece-docker"
@@ -37,7 +38,8 @@
3738
"psr-4": {
3839
"Magento\\CloudDocker\\": "src/",
3940
"Magento\\CloudDocker\\Test\\Integration\\": "tests/integration",
40-
"Magento\\CloudDocker\\Test\\Functional\\": "tests/functional/"
41+
"Magento\\CloudDocker\\Test\\Functional\\": "tests/functional/",
42+
"Magento\\CloudDocker\\Test\\Functional\\Support\\": "tests/functional/_support/"
4143
}
4244
},
4345
"scripts": {
@@ -55,7 +57,8 @@
5557
"test:integration": "phpunit --configuration tests/integration"
5658
},
5759
"config": {
58-
"sort-packages": true
60+
"sort-packages": true,
61+
"optimize-autoloader": true
5962
},
6063
"prefer-stable": true,
6164
"extra": {

src/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/**
1414
* @inheritdoc
1515
*
16-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
16+
* @SuppressWarnings("PHPMD.CouplingBetweenObjects")
1717
*/
1818
class Application extends \Symfony\Component\Console\Application
1919
{

src/Command/BuildCompose.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
/**
2626
* Builds Docker configuration for Magento project.
2727
*
28-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
28+
* @SuppressWarnings("PHPMD.CouplingBetweenObjects")
2929
*/
3030
class BuildCompose extends Command
3131
{
@@ -82,7 +82,7 @@ public function __construct(
8282
/**
8383
* {@inheritdoc}
8484
*
85-
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
85+
* @SuppressWarnings("PHPMD.ExcessiveMethodLength")
8686
*/
8787
protected function configure(): void
8888
{

src/Command/BuildCustomCompose.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
/**
2828
* Build configuration from custom-provided source.
2929
*
30-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
30+
* @SuppressWarnings("PHPMD.CouplingBetweenObjects")
3131
*/
3232
class BuildCustomCompose extends Command
3333
{

src/Command/Image/GeneratePhp.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ private function build(string $version, string $edition): void
218218
* @throws ConfigurationMismatchException
219219
* @throws FileNotFoundException
220220
*
221-
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
222-
* @SuppressWarnings(PHPMD.NPathComplexity)
223-
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
221+
* @SuppressWarnings("PHPMD.CyclomaticComplexity")
222+
* @SuppressWarnings("PHPMD.NPathComplexity")
223+
* @SuppressWarnings("PHPMD.ExcessiveMethodLength")
224224
*/
225225
private function buildDockerfile(string $dockerfile, string $phpVersion, string $edition): string
226226
{

src/Compose/DeveloperBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function __construct(
8484
/**
8585
* {@inheritDoc}
8686
*
87-
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
87+
* @SuppressWarnings("PHPMD.CyclomaticComplexity")
8888
*/
8989
public function build(Config $config): Manager
9090
{

src/Compose/Php/ExtensionResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public function get(Config $config): array
158158
/**
159159
* @return array
160160
*
161-
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
161+
* @SuppressWarnings("PHPMD.ExcessiveMethodLength")
162162
*/
163163
public static function getConfig(): array
164164
{

src/Compose/ProductionBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ public function __construct(
8383
/**
8484
* {@inheritdoc}
8585
*
86-
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
87-
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
88-
* @SuppressWarnings(PHPMD.NPathComplexity)
86+
* @SuppressWarnings("PHPMD.ExcessiveMethodLength")
87+
* @SuppressWarnings("PHPMD.CyclomaticComplexity")
88+
* @SuppressWarnings("PHPMD.NPathComplexity")
8989
*/
9090
public function build(Config $config): Manager
9191
{

src/Config/Source/CliSource.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ public function __construct(InputInterface $input)
166166
/**
167167
* {@inheritDoc}
168168
*
169-
* @SuppressWarnings(PHPMD.NPathComplexity)
170-
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
171-
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
169+
* @SuppressWarnings("PHPMD.NPathComplexity")
170+
* @SuppressWarnings("PHPMD.CyclomaticComplexity")
171+
* @SuppressWarnings("PHPMD.ExcessiveMethodLength")
172172
*/
173173
public function read(): Repository
174174
{

src/Service/ServiceFactory.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public function __construct(FileList $fileList)
191191
* @param string $name
192192
* @param string $version
193193
* @param array $config
194-
* @param string $image
194+
* @param string|null $image
195195
* @param string|null $customRegistry
196196
* @param string|null $imagePattern
197197
* @return array
@@ -201,9 +201,9 @@ public function create(
201201
string $name,
202202
string $version,
203203
array $config = [],
204-
string $image = null,
205-
string $customRegistry = null,
206-
string $imagePattern = null
204+
?string $image = null,
205+
?string $customRegistry = null,
206+
?string $imagePattern = null
207207
): array {
208208
if (!array_key_exists($name, self::$config)) {
209209
throw new ConfigurationMismatchException(sprintf(

0 commit comments

Comments
 (0)