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 Feb 20, 2020
1 parent 9d8cbb6 commit 699462f
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 150 deletions.
4 changes: 0 additions & 4 deletions src/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ class Email extends StringScalar

/**
* Check if the given string is a valid email.
*
* @param string $stringValue
*
* @return bool
*/
protected function isValid(string $stringValue): bool
{
Expand Down
12 changes: 0 additions & 12 deletions src/JSON.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ class JSON extends ScalarType

/**
* Serializes an internal value to include in a response.
*
* @param mixed $value
*
* @return string
*/
public function serialize($value): string
{
Expand All @@ -37,11 +33,8 @@ public function serialize($value): string
*
* In the case of an invalid value this method must throw an Exception
*
* @param mixed $value
*
* @throws Error
*
* @return mixed
*/
public function parseValue($value)
{
Expand All @@ -57,8 +50,6 @@ public function parseValue($value)
* @param mixed[]|null $variables
*
* @throws Exception
*
* @return mixed
*/
public function parseLiteral($valueNode, ?array $variables = null)
{
Expand All @@ -74,11 +65,8 @@ public function parseLiteral($valueNode, ?array $variables = null)
/**
* Try to decode a user-given value into JSON.
*
* @param mixed $value
*
* @throws Error
*
* @return mixed
*/
protected function decodeJSON($value)
{
Expand Down
10 changes: 0 additions & 10 deletions src/Mixed.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ class Mixed extends ScalarType

/**
* Serializes an internal value to include in a response.
*
* @param mixed $value
*
* @return mixed
*/
public function serialize($value)
{
Expand All @@ -37,10 +33,6 @@ public function serialize($value)
* 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
*/
public function parseValue($value)
{
Expand All @@ -56,8 +48,6 @@ public function parseValue($value)
* @param mixed[]|null $variables
*
* @throws \Exception
*
* @return mixed
*/
public function parseLiteral($valueNode, ?array $variables = null)
{
Expand Down
19 changes: 0 additions & 19 deletions src/Regex.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,11 @@ public static function regex(): string

/**
* Return the Regex that the values are validated against.
*
* @return string
*/
abstract public static function regex(): string;

/**
* Serializes an internal value to include in a response.
*
* @param mixed $value
*
* @return string
*/
public function serialize($value): string
{
Expand All @@ -76,10 +70,6 @@ public function serialize($value): string

/**
* Determine if the given string matches the regex defined in this class.
*
* @param string $value
*
* @return bool
*/
protected static function matchesRegex(string $value): bool
{
Expand All @@ -94,11 +84,8 @@ protected static function matchesRegex(string $value): bool
/**
* Parses an externally provided value (query variable) to use as an input.
*
* @param mixed $value
*
* @throws Error
*
* @return string
*/
public function parseValue($value): string
{
Expand All @@ -120,8 +107,6 @@ public function parseValue($value): string
* @param mixed[]|null $variables
*
* @throws Error
*
* @return string
*/
public function parseLiteral($valueNode, ?array $variables = null): string
{
Expand All @@ -139,10 +124,6 @@ public function parseLiteral($valueNode, ?array $variables = null): string

/**
* Construct the error message that occurs when the given string does not match the regex.
*
* @param string $value
*
* @return string
*/
public static function unmatchedRegexMessage(string $value): string
{
Expand Down
20 changes: 0 additions & 20 deletions src/StringScalar.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ public static function make(string $name, ?string $description, callable $isVali

/**
* Check if the given string is a valid email.
*
* @param string $stringValue
*
* @return bool
*/
protected function isValid(string $stringValue): bool
{
Expand All @@ -51,21 +47,14 @@ protected function isValid(string $stringValue): bool

/**
* Check if the given string is valid.
*
* @param string $stringValue
*
* @return bool
*/
abstract protected function isValid(string $stringValue): bool;

/**
* Serializes an internal value to include in a response.
*
* @param mixed $value
*
* @throws InvariantViolation
*
* @return string
*/
public function serialize($value): string
{
Expand All @@ -82,10 +71,6 @@ public function serialize($value): string

/**
* Construct an error message that occurs when an invalid string is passed.
*
* @param string $stringValue
*
* @return string
*/
public function invalidStringMessage(string $stringValue): string
{
Expand All @@ -97,11 +82,8 @@ public function invalidStringMessage(string $stringValue): string
/**
* Parses an externally provided value (query variable) to use as an input.
*
* @param mixed $value
*
* @throws Error
*
* @return string
*/
public function parseValue($value): string
{
Expand All @@ -128,8 +110,6 @@ public function parseValue($value): string
* @param mixed[]|null $variables
*
* @throws Error
*
* @return string
*/
public function parseLiteral($valueNode, ?array $variables = null): string
{
Expand Down
11 changes: 0 additions & 11 deletions src/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

/**
* Check if a value can be serialized to a string.
*
* @param mixed $value
*
* @return bool
*/
function canBeString($value): bool
{
Expand All @@ -25,11 +21,8 @@ function canBeString($value): bool
/**
* Get the underlying string from a GraphQL literal and throw if Literal is not a string.
*
* @param mixed $valueNode
*
* @throws Error
*
* @return string
*/
function extractStringFromLiteral($valueNode): string
{
Expand All @@ -45,12 +38,8 @@ function extractStringFromLiteral($valueNode): string
/**
* Convert the value to a string and throw an exception if it is not possible.
*
* @param mixed $value
* @param string $exceptionClass
*
* @throws \Exception of type $exceptionClass
*
* @return string
*/
function coerceToString($value, string $exceptionClass): string
{
Expand Down
12 changes: 0 additions & 12 deletions tests/MixedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ public function singleValues(): array
/**
* @dataProvider literalToPhpMap
*
* @param string $graphQLLiteral
* @param string $jsonLiteral
* @param mixed $expected
*/
public function testCastsValuesIntoAppropriatePhpValue(string $graphQLLiteral, string $jsonLiteral, $expected): void
Expand Down Expand Up @@ -165,11 +163,6 @@ public function literalToPhpMap(): array
];
}

/**
* @param string $literal
*
* @return ExecutionResult
*/
protected function executeQueryWithLiteral(string $literal): ExecutionResult
{
$query = "
Expand All @@ -184,11 +177,6 @@ protected function executeQueryWithLiteral(string $literal): ExecutionResult
);
}

/**
* @param string $jsonLiteral
*
* @return ExecutionResult
*/
protected function executeQueryWithJsonVariable(string $jsonLiteral): ExecutionResult
{
$query = '
Expand Down
2 changes: 0 additions & 2 deletions tests/MyRegex.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ class MyRegex extends Regex

/**
* Return the Regex that the values are validated against.
*
* @return string
*/
public static function regex(): string
{
Expand Down
4 changes: 0 additions & 4 deletions tests/MyStringScalar.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ class MyStringScalar extends StringScalar

/**
* Check if the given string is exactly "foo".
*
* @param string $stringValue
*
* @return bool
*/
protected function isValid(string $stringValue): bool
{
Expand Down
Loading

0 comments on commit 699462f

Please sign in to comment.