Skip to content

Commit 8bfc344

Browse files
committed
MC-18945: Reading deprecated annotation in schema
- added the changes from static and integration fixes
1 parent b20e4c9 commit 8bfc344

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

dev/tests/integration/testsuite/Magento/Framework/GraphQl/Config/GraphQlReaderTest.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,13 @@ enumValues(includeDeprecated: true) {
200200
$sortFields = ['inputFields', 'fields'];
201201
foreach ($sortFields as $sortField) {
202202
isset($searchTerm[$sortField]) && is_array($searchTerm[$sortField])
203-
? usort($searchTerm[$sortField], function ($a, $b) {
203+
? usort(
204+
$searchTerm[$sortField], function ($a, $b) {
204205
$cmpField = 'name';
205206
return isset($a[$cmpField]) && isset($b[$cmpField])
206207
? strcmp($a[$cmpField], $b[$cmpField]) : 0;
207-
}) : null;
208+
}
209+
) : null;
208210
}
209211

210212
$this->assertTrue(
@@ -240,18 +242,13 @@ enumValues(includeDeprecated: true) {
240242
$expectedOutput
241243
)
242244
);
243-
244245
}
245246

246-
247247
/**
248248
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
249249
*/
250250
public function testDispatchIntrospectionWithDeprecatedSDL()
251251
{
252-
253-
254-
255252
$query
256253
= <<<QUERY
257254
query IntrospectionQuery {
@@ -368,7 +365,6 @@ enumValues(includeDeprecated: true) {
368365
$this->jsonSerializer->unserialize($response->getContent());
369366
$expectedOutput = require __DIR__ . '/../_files/schema_response_sdl_deprecated_annotation.php';
370367

371-
372368
//Checks to make sure that the given description exists in the expectedOutput array
373369

374370
$this->assertTrue(

lib/internal/Magento/Framework/GraphQlSchemaStitching/GraphQlReader/MetaReader/FieldMetaReader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ public function read(\GraphQL\Type\Definition\FieldDefinition $fieldMeta) : arra
100100
}
101101
$typeMeta = $argumentMeta->getType();
102102

103-
$result['arguments'][$argumentName] = array_merge_recursive(
103+
// phpcs:ignore Magento2.Performance.ForeachArrayMerge.ForeachArrayMerge
104+
$result['arguments'][$argumentName] = array_merge(
104105
$result['arguments'][$argumentName],
105106
$this->typeMetaReader->read($typeMeta, TypeMetaWrapperReader::ARGUMENT_PARAMETER)
106107
);

0 commit comments

Comments
 (0)