mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-23 13:26:04 +03:00
Little fixes
This commit is contained in:
parent
6cce6742eb
commit
644f97634b
@ -17,6 +17,8 @@
|
|||||||
<exclude name="SlevomatCodingStandard.Classes.ClassConstantVisibility.MissingConstantVisibility" />
|
<exclude name="SlevomatCodingStandard.Classes.ClassConstantVisibility.MissingConstantVisibility" />
|
||||||
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint" />
|
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint" />
|
||||||
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint" />
|
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint" />
|
||||||
|
<!-- Enable when Slevomat starts supporting variadics, see https://github.com/slevomat/coding-standard/issues/251 -->
|
||||||
|
<exclude name="SlevomatCodingStandard.Namespaces.UnusedUses.UnusedUse" />
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<!--@api annotation is required for now -->
|
<!--@api annotation is required for now -->
|
||||||
|
@ -123,7 +123,7 @@ class SyncPromise
|
|||||||
|
|
||||||
if ($this->state === self::FULFILLED) {
|
if ($this->state === self::FULFILLED) {
|
||||||
try {
|
try {
|
||||||
$promise->resolve($onFulfilled ? $onFulfilled($this->result) : $this->result);
|
$promise->resolve($onFulfilled === null ? $this->result : $onFulfilled($this->result));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$promise->reject($e);
|
$promise->reject($e);
|
||||||
} catch (Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
@ -131,10 +131,10 @@ class SyncPromise
|
|||||||
}
|
}
|
||||||
} elseif ($this->state === self::REJECTED) {
|
} elseif ($this->state === self::REJECTED) {
|
||||||
try {
|
try {
|
||||||
if ($onRejected) {
|
if ($onRejected === null) {
|
||||||
$promise->resolve($onRejected($this->result));
|
|
||||||
} else {
|
|
||||||
$promise->reject($this->result);
|
$promise->reject($this->result);
|
||||||
|
} else {
|
||||||
|
$promise->resolve($onRejected($this->result));
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$promise->reject($e);
|
$promise->reject($e);
|
||||||
|
@ -188,7 +188,7 @@ class EnumType extends Type implements InputType, OutputType, LeafType, NamedTyp
|
|||||||
$lookup = $this->getNameLookup();
|
$lookup = $this->getNameLookup();
|
||||||
if (isset($lookup[$valueNode->value])) {
|
if (isset($lookup[$valueNode->value])) {
|
||||||
$enumValue = $lookup[$valueNode->value];
|
$enumValue = $lookup[$valueNode->value];
|
||||||
if ($enumValue) {
|
if ($enumValue !== null) {
|
||||||
return $enumValue->value;
|
return $enumValue->value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ use GraphQL\Type\Definition\InputType;
|
|||||||
use GraphQL\Type\Definition\InterfaceType;
|
use GraphQL\Type\Definition\InterfaceType;
|
||||||
use GraphQL\Type\Definition\ListOfType;
|
use GraphQL\Type\Definition\ListOfType;
|
||||||
use GraphQL\Type\Definition\ObjectType;
|
use GraphQL\Type\Definition\ObjectType;
|
||||||
|
use GraphQL\Type\Definition\OutputType;
|
||||||
use GraphQL\Type\Definition\Type;
|
use GraphQL\Type\Definition\Type;
|
||||||
use GraphQL\Type\Definition\UnionType;
|
use GraphQL\Type\Definition\UnionType;
|
||||||
use GraphQL\Type\Definition\WrappingType;
|
use GraphQL\Type\Definition\WrappingType;
|
||||||
|
@ -366,8 +366,8 @@ class OverlappingFieldsCanBeMerged extends ValidationRule
|
|||||||
);
|
);
|
||||||
|
|
||||||
// The return type for each field.
|
// The return type for each field.
|
||||||
$type1 = $def1 ? $def1->getType() : null;
|
$type1 = $def1 === null ? null : $def1->getType();
|
||||||
$type2 = $def2 ? $def2->getType() : null;
|
$type2 = $def2 === null ? null : $def2->getType();
|
||||||
|
|
||||||
if (! $areMutuallyExclusive) {
|
if (! $areMutuallyExclusive) {
|
||||||
// Two aliases must refer to the same field.
|
// Two aliases must refer to the same field.
|
||||||
|
Loading…
Reference in New Issue
Block a user