Skip to content

Commit 2c2f450

Browse files
Fixing static test failures
1 parent f2832e7 commit 2c2f450

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

lib/internal/Magento/Framework/GraphQl/Type/Definition/FloatType.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,18 @@ public function parseValue($value): float
4545
public function parseLiteral(Node $valueNode, ?array $variables = null): float
4646
{
4747
try {
48-
if (
49-
$valueNode instanceof ValueNode
48+
if ($valueNode instanceof ValueNode
5049
&& !($valueNode instanceof FloatValueNode)
5150
&& !($valueNode instanceof IntValueNode)
52-
&& isset($valueNode->value)
53-
) {
51+
&& isset($valueNode->value))
52+
{
5453
$valueNode = new FloatValueNode([
5554
'value' => (string)$this->parseValue($valueNode->value),
5655
'loc' => $valueNode->loc
5756
]);
5857
}
5958
} catch (Exception $e) {
59+
// If parsing fails let it go through the regular method to throw the expected error
6060
}
6161
return parent::parseLiteral($valueNode, $variables);
6262
}

lib/internal/Magento/Framework/GraphQl/Type/Definition/IntType.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/**
1717
* Replacement for the IntType definition that can typecast non-numeric values for backwards compatibility
1818
*/
19-
class IntType extends \GraphQl\Type\Definition\IntType
19+
class IntType extends \GraphQL\Type\Definition\IntType
2020
{
2121
/**
2222
* Try to typecast valid values before running the native validations
@@ -44,17 +44,17 @@ public function parseValue($value): int
4444
public function parseLiteral(Node $valueNode, ?array $variables = null): int
4545
{
4646
try {
47-
if (
48-
$valueNode instanceof ValueNode
47+
if ($valueNode instanceof ValueNode
4948
&& !($valueNode instanceof IntValueNode)
50-
&& isset($valueNode->value)
51-
) {
49+
&& isset($valueNode->value))
50+
{
5251
$valueNode = new IntValueNode([
5352
'value' => (string)$this->parseValue($valueNode->value),
5453
'loc' => $valueNode->loc
5554
]);
5655
}
5756
} catch (Exception $e) {
57+
// If parsing fails let it go through the regular method to throw the expected error
5858
}
5959
return parent::parseLiteral($valueNode, $variables);
6060
}

lib/internal/Magento/Framework/GraphQl/Type/Definition/StringType.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/**
1717
* Replacement for the StringType definition that can typecast non-string values for backwards compatibility
1818
*/
19-
class StringType extends \GraphQl\Type\Definition\StringType
19+
class StringType extends \GraphQL\Type\Definition\StringType
2020
{
2121
/**
2222
* Try to typecast valid values before running the native validations
@@ -44,17 +44,17 @@ public function parseValue($value): string
4444
public function parseLiteral(Node $valueNode, ?array $variables = null): string
4545
{
4646
try {
47-
if (
48-
$valueNode instanceof ValueNode
47+
if ($valueNode instanceof ValueNode
4948
&& !($valueNode instanceof StringValueNode)
50-
&& isset($valueNode->value)
51-
) {
49+
&& isset($valueNode->value))
50+
{
5251
$valueNode = new StringValueNode([
5352
'value' => $this->parseValue($valueNode->value),
5453
'loc' => $valueNode->loc
5554
]);
5655
}
5756
} catch (Exception $e) {
57+
// If parsing fails let it go through the regular method to throw the expected error
5858
}
5959
return parent::parseLiteral($valueNode, $variables);
6060
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,6 @@ private function addModuleNameToTypes(array $source, string $filePath): array
350350
return $source;
351351
}
352352

353-
354353
/**
355354
* Replace the standard type definitions with ones that know how to cast input values
356355
*/

0 commit comments

Comments
 (0)