Skip to content

Commit d3731f4

Browse files
authored
Merge branch '2.4-develop' into AC-109-combined
2 parents 594e114 + 1ef4504 commit d3731f4

File tree

15 files changed

+155
-185
lines changed

15 files changed

+155
-185
lines changed

app/code/Magento/Backend/App/DefaultPath.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22
/**
3-
* Default application path for backend area
4-
*
53
* Copyright © Magento, Inc. All rights reserved.
64
* See COPYING.txt for license details.
75
*/
86
namespace Magento\Backend\App;
97

108
/**
9+
* Default application path for backend area
10+
*
1111
* @api
1212
* @since 100.0.2
1313
*/
@@ -24,7 +24,11 @@ class DefaultPath implements \Magento\Framework\App\DefaultPathInterface
2424
*/
2525
public function __construct(\Magento\Backend\App\ConfigInterface $config)
2626
{
27-
$pathParts = explode('/', $config->getValue('web/default/admin'));
27+
$pathConfigValue = $config->getValue('web/default/admin') ?? '';
28+
$pathParts = [];
29+
if ($pathConfigValue) {
30+
$pathParts = explode('/', $pathConfigValue);
31+
}
2832

2933
$this->_parts = [
3034
'area' => isset($pathParts[0]) ? $pathParts[0] : '',

app/code/Magento/Backend/view/adminhtml/templates/widget/tabshoriz.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use Magento\Framework\View\Helper\SecureHtmlRenderer;
1919
<?php foreach ($tabs as $_tab): ?>
2020
<?php $tabId = $block->getTabId($_tab) ?>
2121
<?php $_tabClass = 'tab-item-link ' . $block->getTabClass($_tab) . ' ' .
22-
(preg_match('/\s?ajax\s?/', $_tab->getClass()) ? 'notloaded' : '') ?>
22+
($_tab->getClass() !== null ? (preg_match('/\s?ajax\s?/', $_tab->getClass()) ? 'notloaded' : '') : '') ?>
2323
<?php $_tabType = (!preg_match('/\s?ajax\s?/', $_tabClass) && $block->getTabUrl($_tab) != '#') ? 'link' : '' ?>
2424
<?php $_tabHref = $block->getTabUrl($_tab) == '#' ?
2525
'#' . $tabId . '_content' :

app/code/Magento/Eav/Model/Entity/Type.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ public function getValueTablePrefix()
303303
*/
304304
public function getEntityTablePrefix()
305305
{
306-
$tablePrefix = trim($this->_data['value_table_prefix']);
306+
$tablePrefix = isset($this->_data['value_table_prefix']) ? trim($this->_data['value_table_prefix']) : '';
307307

308308
if (empty($tablePrefix)) {
309309
$tablePrefix = $this->getEntityTable();

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888
"magento/magento-coding-standard": "*",
8989
"magento/magento2-functional-testing-framework": "^3.7",
9090
"pdepend/pdepend": "~2.10.0",
91-
"phpcompatibility/php-compatibility": "^9.3",
9291
"phpmd/phpmd": "^2.9.1",
9392
"phpstan/phpstan": "~1.1.0",
9493
"phpunit/phpunit": "~9.5.0",

composer.lock

Lines changed: 69 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/tests/static/framework/Magento/TestFramework/CodingStandard/Tool/PhpCompatibility.php

Lines changed: 0 additions & 25 deletions
This file was deleted.

dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -208,43 +208,6 @@ private function getFullWhitelist()
208208
}
209209
}
210210

211-
/**
212-
* Retrieves the lowest and highest PHP version specified in <kbd>composer.json</var> of project.
213-
*
214-
* @return array
215-
*/
216-
private function getTargetPhpVersions(): array
217-
{
218-
$composerJson = json_decode(file_get_contents(BP . '/composer.json'), true);
219-
$versionsRange = [];
220-
221-
if (isset($composerJson['require']['php'])) {
222-
$versions = explode('||', $composerJson['require']['php']);
223-
224-
//normalize version constraints
225-
foreach ($versions as $key => $version) {
226-
$version = ltrim($version, '^~');
227-
$version = str_replace('*', '999', $version);
228-
229-
$versions[$key] = $version;
230-
}
231-
232-
//sort versions
233-
usort($versions, 'version_compare');
234-
235-
$versionsRange[] = array_shift($versions);
236-
if (!empty($versions)) {
237-
$versionsRange[] = array_pop($versions);
238-
}
239-
foreach ($versionsRange as $key => $version) {
240-
$versionParts = explode('.', $versionsRange[$key]);
241-
$versionsRange[$key] = sprintf('%s.%s', $versionParts[0], $versionParts[1] ?? '0');
242-
}
243-
}
244-
245-
return $versionsRange;
246-
}
247-
248211
/**
249212
* Returns whether a full scan was requested.
250213
*
@@ -405,39 +368,6 @@ public function testStrictTypes()
405368
);
406369
}
407370

408-
/**
409-
* Test for compatibility to lowest PHP version declared in <kbd>composer.json</kbd>.
410-
*/
411-
public function testPhpCompatibility()
412-
{
413-
$targetVersions = $this->getTargetPhpVersions();
414-
$this->assertNotEmpty($targetVersions, 'No supported versions information in composer.json');
415-
$reportFile = self::$reportDir . '/phpcompatibility_report.txt';
416-
$rulesetDir = __DIR__ . '/_files/PHPCompatibilityMagento';
417-
418-
if (!file_exists($reportFile)) {
419-
touch($reportFile);
420-
}
421-
422-
$codeSniffer = new PhpCompatibility($rulesetDir, $reportFile, new Wrapper());
423-
if (count($targetVersions) > 1) {
424-
$codeSniffer->setTestVersion($targetVersions[0] . '-' . $targetVersions[1]);
425-
} else {
426-
$codeSniffer->setTestVersion($targetVersions[0]);
427-
}
428-
429-
$result = $codeSniffer->run(
430-
$this->isFullScan() ? $this->getFullWhitelist() : self::getWhitelist(['php', 'phtml'])
431-
);
432-
$report = file_get_contents($reportFile);
433-
434-
$this->assertEquals(
435-
0,
436-
$result,
437-
'PHP Compatibility detected violation(s):' . PHP_EOL . $report
438-
);
439-
}
440-
441371
/**
442372
* Test code quality using PHPStan
443373
*

dev/tests/static/testsuite/Magento/Test/Php/_files/PHPCompatibilityMagento/ruleset.xml

Lines changed: 0 additions & 13 deletions
This file was deleted.

lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,10 +1760,10 @@ public function getColumnCreateByDescribe($columnData)
17601760
if ($columnData['DEFAULT'] !== null && $type != Table::TYPE_TEXT) {
17611761
$options['default'] = $this->quote($columnData['DEFAULT']);
17621762
}
1763-
if (strlen($columnData['SCALE']) > 0) {
1763+
if (isset($columnData['SCALE']) && strlen($columnData['SCALE']) > 0) {
17641764
$options['scale'] = $columnData['SCALE'];
17651765
}
1766-
if (strlen($columnData['PRECISION']) > 0) {
1766+
if (isset($columnData['PRECISION']) && strlen($columnData['PRECISION']) > 0) {
17671767
$options['precision'] = $columnData['PRECISION'];
17681768
}
17691769

0 commit comments

Comments
 (0)