Skip to content

Commit c27ed28

Browse files
committed
Merge branch 'magento2_platform-health' into platform-health
2 parents 0569bf6 + 5682fa3 commit c27ed28

File tree

17 files changed

+81
-48
lines changed

17 files changed

+81
-48
lines changed

Gruntfile.js.sample

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ module.exports = function (grunt) {
1616
tasks = grunt.file.expand('./dev/tools/grunt/tasks/*'),
1717
themes;
1818

19-
filesRouter.set('themes', 'dev/tools/grunt/configs/themes');
20-
themes = filesRouter.get('themes');
19+
filesRouter.set('themes', 'dev/tools/grunt/configs/themes');
20+
themes = filesRouter.get('themes');
2121

22-
tasks = _.map(tasks, function(task){ return task.replace('.js', '') });
22+
tasks = _.map(tasks, function (task) {
23+
return task.replace('.js', '');
24+
});
2325
tasks.push('time-grunt');
2426
tasks.forEach(function (task) {
2527
require(task)(grunt);
@@ -53,7 +55,7 @@ module.exports = function (grunt) {
5355
'autoprefixer',
5456
'cssmin',
5557
'usebanner'
56-
].map(function(task){
58+
].map(function (task) {
5759
return task + ':' + component;
5860
});
5961

@@ -72,7 +74,7 @@ module.exports = function (grunt) {
7274
'clean',
7375
'exec:all'
7476
];
75-
_.each(themes, function(theme, name) {
77+
_.each(themes, function (theme, name) {
7678
tasks.push('less:' + name);
7779
});
7880
grunt.task.run(tasks);

app/code/Magento/AwsS3/Driver/AwsS3.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ public function fileClose($resource): bool
851851
//phpcs:enable
852852

853853
foreach ($this->streams as $path => $stream) {
854-
//phpcs:disable
854+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
855855
if (stream_get_meta_data($stream)['uri'] === $resourcePath) {
856856
$this->adapter->writeStream($path, $resource, new Config(self::CONFIG));
857857

app/code/Magento/Catalog/Model/Product/ProductFrontendAction/Synchronizer.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,9 @@ private function filterNewestActions(array $productsData, $typeId)
133133
$productsData,
134134
function (array $firstProduct, array $secondProduct) {
135135
if (isset($firstProduct['added_at'], $secondProduct['added_at'])) {
136-
return $firstProduct['added_at'] > $secondProduct['added_at'];
136+
return ($firstProduct['added_at'] <=> $secondProduct['added_at']);
137137
}
138-
139-
return false;
138+
return 0;
140139
}
141140
);
142141

app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/ExtractDataFromCategoryTree.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private function sortTree(array $tree): array
154154
foreach ($tree as &$node) {
155155
if ($node['children']) {
156156
uasort($node['children'], function ($element1, $element2) {
157-
return $element1['position'] > $element2['position'];
157+
return ($element1['position'] <=> $element2['position']);
158158
});
159159
$node['children'] = $this->sortTree($node['children']);
160160
if (isset($node['children_count'])) {

app/code/Magento/Config/App/Config/Source/DumpConfigSourceAggregated.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ private function filterPath($path)
209209
private function sortSources()
210210
{
211211
uasort($this->sources, function ($firstItem, $secondItem) {
212-
return $firstItem['sortOrder'] > $secondItem['sortOrder'];
212+
return ($firstItem['sortOrder'] <=> $secondItem['sortOrder']);
213213
});
214214
}
215215

app/code/Magento/GraphQl/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"magento/framework": "*",
99
"magento/module-webapi": "*",
1010
"magento/module-authorization": "*",
11-
"webonyx/graphql-php": "^14.9.0"
11+
"webonyx/graphql-php": "~14.9.0"
1212
},
1313
"suggest": {
1414
"magento/module-graph-ql-cache": "*"

dev/tests/integration/testsuite/Magento/Framework/Jwt/JwtManagerTest.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ private function createRsaKeys(): array
997997
if (!openssl_pkey_export($rsaPrivateResource, $rsaPrivate, 'pass')) {
998998
throw new \RuntimeException('Failed to read RSA private key');
999999
}
1000-
openssl_free_key($rsaPrivateResource);
1000+
$this->freeResource($rsaPrivateResource);
10011001

10021002
return [$rsaPrivate, $rsaPublic];
10031003
}
@@ -1024,11 +1024,23 @@ private function createEcKeys(): array
10241024
if (!openssl_pkey_export($privateResource, $esPrivate, 'pass')) {
10251025
throw new \RuntimeException('Failed to read EC private key');
10261026
}
1027-
openssl_free_key($privateResource);
1027+
$this->freeResource($privateResource);
10281028
$ecKeys[$bits] = [$esPrivate, $esPublic];
10291029
unset($privateResource, $esPublic, $esPrivate);
10301030
}
10311031

10321032
return $ecKeys;
10331033
}
1034+
1035+
/**
1036+
* @param mixed $resource
1037+
*
1038+
* @return void
1039+
*/
1040+
private function freeResource($resource): void
1041+
{
1042+
if (\is_resource($resource) && (version_compare(PHP_VERSION, '8.0') < 0)) {
1043+
openssl_free_key($resource);
1044+
}
1045+
}
10341046
}

dev/tests/js/jasmine/spec_runner/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function getTasks() {
5757
return [
5858
'connect:' + theme,
5959
'jasmine:' + theme
60-
]
60+
];
6161
});
6262

6363
return _.flatten(tasks);

dev/tests/js/jasmine/spec_runner/tasks/connect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function init(config) {
3939
});
4040

4141
return middlewares;
42-
}
42+
};
4343

4444
_.each(themes, function (themeData, themeName) {
4545
var options = {

dev/tests/js/jasmine/spec_runner/tasks/jasmine.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function init(config) {
1515
themes, root, staticDir, baseUrl, mapFile, host, port, files, requireJs;
1616

1717
root = config.root;
18-
staticDir = config.static;
18+
staticDir = config.static;
1919
port = config.port;
2020
files = config.files;
2121
themes = config.themes;
@@ -69,7 +69,7 @@ function init(config) {
6969
*/
7070
helpers: specs
7171
}
72-
}
72+
};
7373
});
7474
}
7575

0 commit comments

Comments
 (0)