Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia authored and StyleCIBot committed Mar 28, 2019
1 parent 86ccf59 commit da8f4a3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/JSON.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,38 +33,38 @@ public function serialize($value): string
}

/**
* Parses an externally provided value (query variable) to use as an input
* Parses an externally provided value (query variable) to use as an input.
*
* In the case of an invalid value this method must throw an Exception
*
* @param mixed $value
*
* @return mixed
*
* @throws Error
*
* @return mixed
*/
public function parseValue($value)
{
return $this->decodeJSON($value);
}

/**
* Parses an externally provided literal value (hardcoded in GraphQL query) to use as an input
* Parses an externally provided literal value (hardcoded in GraphQL query) to use as an input.
*
* In the case of an invalid node or value this method must throw an Exception
*
* @param Node $valueNode
* @param mixed[]|null $variables
*
* @return mixed
*
* @throws Exception
*
* @return mixed
*/
public function parseLiteral($valueNode, ?array $variables = null)
{
if(!property_exists($valueNode, 'value')){
if (!property_exists($valueNode, 'value')) {
throw new Error(
'Can only parse literals that contain a value, got ' . Utils::printSafeJson($valueNode)
'Can only parse literals that contain a value, got '.Utils::printSafeJson($valueNode)
);
}

Expand All @@ -76,9 +76,9 @@ public function parseLiteral($valueNode, ?array $variables = null)
*
* @param mixed $value
*
* @return mixed
*
* @throws Error
*
* @return mixed
*/
protected function decodeJSON($value)
{
Expand Down

0 comments on commit da8f4a3

Please sign in to comment.