From a6cc13314d73a0256a155cdcc2cd23278c5a2905 Mon Sep 17 00:00:00 2001 From: Vitaliy Chesnokov Date: Fri, 19 Jul 2019 18:57:49 +0300 Subject: [PATCH] Fix switch...continue for php 7.3 --- src/Executor/Executor.php | 8 ++++---- src/Validator/Rules/OverlappingFieldsCanBeMerged.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index 998038d..8a06172 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -529,7 +529,7 @@ class Executor switch ($selection->kind) { case NodeKind::FIELD: if (!$this->shouldIncludeNode($selection)) { - continue; + continue 2; } $name = self::getFieldEntryKey($selection); if (!isset($fields[$name])) { @@ -541,7 +541,7 @@ class Executor if (!$this->shouldIncludeNode($selection) || !$this->doesFragmentConditionMatch($selection, $runtimeType) ) { - continue; + continue 2; } $this->collectFields( $runtimeType, @@ -553,14 +553,14 @@ class Executor case NodeKind::FRAGMENT_SPREAD: $fragName = $selection->name->value; if (!empty($visitedFragmentNames[$fragName]) || !$this->shouldIncludeNode($selection)) { - continue; + continue 2; } $visitedFragmentNames[$fragName] = true; /** @var FragmentDefinitionNode|null $fragment */ $fragment = isset($exeContext->fragments[$fragName]) ? $exeContext->fragments[$fragName] : null; if (!$fragment || !$this->doesFragmentConditionMatch($fragment, $runtimeType)) { - continue; + continue 2; } $this->collectFields( $runtimeType, diff --git a/src/Validator/Rules/OverlappingFieldsCanBeMerged.php b/src/Validator/Rules/OverlappingFieldsCanBeMerged.php index d0a0fb0..10677a0 100644 --- a/src/Validator/Rules/OverlappingFieldsCanBeMerged.php +++ b/src/Validator/Rules/OverlappingFieldsCanBeMerged.php @@ -352,12 +352,12 @@ class OverlappingFieldsCanBeMerged extends AbstractValidationRule /** @var FragmentSpreadNode $selection */ $fragName = $selection->name->value; if (!empty($_visitedFragmentNames[$fragName])) { - continue; + continue 2; } $_visitedFragmentNames[$fragName] = true; $fragment = $context->getFragment($fragName); if (!$fragment) { - continue; + continue 2; } $fragmentType = TypeInfo::typeFromAST($context->getSchema(), $fragment->typeCondition); $_astAndDefs = $this->collectFieldNodesAndDefs(