Skip to content

Commit 1475eb2

Browse files
authored
Merge pull request #8696 from magento-gl/Hammer_PlatForm_Health_247Beta3_03Jan23
[Hammer][Platform Health 247-beta3] ES8 Support Adobe Commerce 2.4.7 and 2.4.6
2 parents 9846306 + 297c0bd commit 1475eb2

File tree

94 files changed

+1037
-589
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+1037
-589
lines changed

app/code/Magento/AwsS3/Test/Mftf/Helper/MockTestLogger.php

Lines changed: 69 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,49 +14,107 @@
1414
*
1515
* Ignores most log messages but throws errors on error/critical/emergency logs so tests will fail
1616
*/
17-
class MockTestLogger implements LoggerInterface {
18-
19-
public function emergency($message, array $context = array())
17+
class MockTestLogger implements LoggerInterface
18+
{
19+
/**
20+
* @param $message
21+
* @param array $context
22+
* @return void
23+
* @throws \Exception
24+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
25+
*/
26+
public function emergency($message, array $context = []): void
2027
{
2128
throw new \Exception($message);
2229
}
2330

24-
public function alert($message, array $context = array())
31+
/**
32+
* @param $message
33+
* @param array $context
34+
* @return void
35+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
36+
*/
37+
public function alert($message, array $context = []): void
2538
{
2639
// noop
2740
}
2841

29-
public function critical($message, array $context = array())
42+
/**
43+
* @param $message
44+
* @param array $context
45+
* @return void
46+
* @throws \Exception
47+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
48+
*/
49+
public function critical($message, array $context = []): void
3050
{
3151
throw new \Exception($message);
3252
}
3353

34-
public function error($message, array $context = array())
54+
/**
55+
* @param $message
56+
* @param array $context
57+
* @return void
58+
* @throws \Exception
59+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
60+
*/
61+
public function error($message, array $context = []): void
3562
{
3663
throw new \Exception($message);
3764
}
3865

39-
public function warning($message, array $context = array())
66+
/**
67+
* @param $message
68+
* @param array $context
69+
* @return void
70+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
71+
*/
72+
public function warning($message, array $context = []): void
4073
{
4174
// noop
4275
}
4376

44-
public function notice($message, array $context = array())
77+
/**
78+
* @param $message
79+
* @param array $context
80+
* @return void
81+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
82+
*/
83+
public function notice($message, array $context = []): void
4584
{
4685
// noop
4786
}
4887

49-
public function info($message, array $context = array())
88+
/**
89+
* @param $message
90+
* @param array $context
91+
* @return void
92+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
93+
*/
94+
public function info($message, array $context = []): void
5095
{
5196
// noop
5297
}
5398

54-
public function debug($message, array $context = array())
99+
/**
100+
* @param $message
101+
* @param array $context
102+
* @return void
103+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
104+
*/
105+
public function debug($message, array $context = []): void
55106
{
56107
// noop
57108
}
58109

59-
public function log($level, $message, array $context = array())
110+
/**
111+
* @param $level
112+
* @param $message
113+
* @param array $context
114+
* @return void
115+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
116+
*/
117+
public function log($level, $message, array $context = []): void
60118
{
61119
// noop
62120
}

app/code/Magento/Captcha/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"magento/module-store": "*",
1515
"magento/module-authorization": "*",
1616
"laminas/laminas-captcha": "^2.12",
17-
"laminas/laminas-db": "^2.13.4"
17+
"laminas/laminas-db": "^2.19"
1818
},
1919
"type": "magento2-module",
2020
"license": [

app/code/Magento/Checkout/Test/Unit/Controller/Sidebar/RemoveItemTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ public function testExecuteWithException()
201201

202202
$this->loggerMock->expects($this->once())
203203
->method('critical')
204-
->with($exception)
205-
->willReturn(null);
204+
->with($exception);
206205

207206
$this->sidebarMock->expects($this->once())
208207
->method('getResponseData')

app/code/Magento/Checkout/Test/Unit/Controller/Sidebar/UpdateItemQtyTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,7 @@ public function testExecuteWithException(): void
217217

218218
$this->loggerMock->expects($this->once())
219219
->method('critical')
220-
->with($exception)
221-
->willReturn(null);
220+
->with($exception);
222221

223222
$this->sidebarMock->expects($this->once())
224223
->method('getResponseData')

app/code/Magento/Deploy/Console/ConsoleLogger.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ class ConsoleLogger extends AbstractLogger
2222
/**
2323
* Type for informational message
2424
*/
25-
const INFO = 'info';
25+
public const INFO = 'info';
2626

2727
/**
2828
* Type for error message
2929
*/
30-
const ERROR = 'error';
30+
public const ERROR = 'error';
3131

3232
/**
3333
* Public static files directory read interface
@@ -132,7 +132,7 @@ public function __construct(
132132
/**
133133
* @inheritdoc
134134
*/
135-
public function log($level, $message, array $context = [])
135+
public function log($level, $message, array $context = []): void
136136
{
137137
if (!isset($this->verbosityLevelMap[$level])) {
138138
$level = self::INFO;
@@ -217,7 +217,7 @@ private function refresh(OutputInterface $output)
217217
* @param array $process
218218
* @return void
219219
*/
220-
private function updateProcessInfo($deployedPackagePath, array & $process)
220+
private function updateProcessInfo($deployedPackagePath, array &$process)
221221
{
222222
$packageDeploymentInfo = $this->getPackageDeploymentInfo($deployedPackagePath . '/info.json');
223223
if ($packageDeploymentInfo) {
@@ -291,7 +291,7 @@ private function renderBar(OutputInterface $output, array $process)
291291
$display = str_repeat('=', $completeBars);
292292
if ($completeBars < 28) {
293293
$emptyBars = 28 - $completeBars
294-
- $this->formatterHelper->strlenWithoutDecoration($output->getFormatter(), '>');
294+
- FormatterHelper::width($this->formatterHelper->removeDecoration($output->getFormatter(), '>'));
295295
$display .= '>' . str_repeat('-', $emptyBars);
296296
}
297297
return $display;

app/code/Magento/Deploy/Test/Unit/Model/FilesystemTest.php

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ public function testRegenerateStatic(): void
149149
$this->shell
150150
->expects($this->exactly(4))
151151
->method('execute')
152-
->withConsecutive([$cacheFlushCmd], [$setupDiCompileCmd], [$cacheFlushCmd], [$staticContentDeployCmd]);
152+
->withConsecutive([$cacheFlushCmd], [$setupDiCompileCmd], [$cacheFlushCmd], [$staticContentDeployCmd])
153+
->willReturn("Compilation complete");
153154

154155
$this->output
155156
->method('writeln')
@@ -176,9 +177,18 @@ public function testGenerateStaticForNotAllowedStoreViewLocale(): void
176177
$this->expectExceptionMessage(
177178
';echo argument has invalid value, run info:language:list for list of available locales'
178179
);
180+
$setupDiCompileCmd = $this->cmdPrefix . 'setup:di:compile';
179181
$storeLocales = ['fr_FR', 'de_DE', ';echo'];
180182
$this->storeView->method('retrieveLocales')
181183
->willReturn($storeLocales);
184+
$cacheFlushCmd = $this->cmdPrefix . 'cache:flush';
185+
$staticContentDeployCmd = $this->cmdPrefix . 'setup:static-content:deploy -f '
186+
. implode(' ', $storeLocales);
187+
$this->shell
188+
->expects($this->exactly(3))
189+
->method('execute')
190+
->withConsecutive([$cacheFlushCmd], [$setupDiCompileCmd], [$cacheFlushCmd], [$staticContentDeployCmd])
191+
->willReturn("Compilation complete");
182192

183193
$this->initAdminLocaleMock('en_US');
184194

@@ -196,9 +206,18 @@ public function testGenerateStaticForNotAllowedAdminLocale(): void
196206
$this->expectExceptionMessage(
197207
';echo argument has invalid value, run info:language:list for list of available locales'
198208
);
209+
$setupDiCompileCmd = $this->cmdPrefix . 'setup:di:compile';
199210
$storeLocales = ['fr_FR', 'de_DE', 'en_US'];
211+
$cacheFlushCmd = $this->cmdPrefix . 'cache:flush';
212+
$staticContentDeployCmd = $this->cmdPrefix . 'setup:static-content:deploy -f '
213+
. implode(' ', $storeLocales);
200214
$this->storeView->method('retrieveLocales')
201215
->willReturn($storeLocales);
216+
$this->shell
217+
->expects($this->exactly(3))
218+
->method('execute')
219+
->withConsecutive([$cacheFlushCmd], [$setupDiCompileCmd], [$cacheFlushCmd], [$staticContentDeployCmd])
220+
->willReturn("Compilation complete");
202221

203222
$this->initAdminLocaleMock(';echo');
204223

app/code/Magento/Developer/Console/Command/GeneratePatchCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
183183
$fileWriter->writeFile($patchFile, $patchTemplateData);
184184

185185
$outputPatchFile = str_replace($this->directoryList->getRoot() . '/', '', $patchDir . '/' . $patchFile);
186-
$output->writeln(__('Patch %1 has been successfully generated.', $outputPatchFile));
186+
$output->writeln(sprintf('Patch 1% has been successfully generated.', $outputPatchFile));
187187

188188
return Cli::RETURN_SUCCESS;
189189
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Elasticsearch\Elasticsearch5\Model\Adapter\BatchDataMapper;
9+
10+
/**
11+
* @deprecated Handle the Backward Compatibility issue with ES7 and ES8
12+
* @see AC-10652
13+
* phpcs:disable Generic.Files.LineLength.TooLong
14+
*/
15+
class CategoryFieldsProvider extends \Magento\Elasticsearch\ElasticAdapter\Model\Adapter\BatchDataMapper\CategoryFieldsProvider
16+
{
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Elasticsearch\Elasticsearch5\Model\Adapter\BatchDataMapper;
9+
10+
/**
11+
* @deprecated Handle the Backward Compatibility issue with ES7 and ES8
12+
* @see AC-10652
13+
* phpcs:disable Generic.Files.LineLength.TooLong
14+
*/
15+
class CategoryFieldsProviderProxy extends \Magento\Elasticsearch\ElasticAdapter\Model\Adapter\BatchDataMapper\CategoryFieldsProviderProxy
16+
{
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldIndex;
9+
10+
/**
11+
* @deprecated Handle the Backward Compatibility issue with ES7 and ES8
12+
* @see AC-10652
13+
* phpcs:disable Generic.Files.LineLength.TooLong
14+
*/
15+
class Converter extends \Magento\Elasticsearch\ElasticAdapter\Model\Adapter\FieldMapper\Product\FieldProvider\FieldIndex\Converter
16+
{
17+
}

0 commit comments

Comments
 (0)