diff --git a/.travis.yml b/.travis.yml index 48edc458..217680f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,8 +13,7 @@ before_script: script: - vendor/bin/phpunit --coverage-clover build/logs/clover.xml - # Allow phpstan failures until we've fixed the majority of them - - composer analyze || true + - composer analyze after_success: - wget https://github.com/php-coveralls/php-coveralls/releases/download/v1.0.1/coveralls.phar -O coveralls.phar diff --git a/composer.json b/composer.json index d7fe0ab2..272fb546 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "phpunit" ], "analyze": [ - "phpstan analyse -l 7 src/ tests/" + "phpstan analyse -l 1 src/ tests/" ] }, "autoload-dev": { diff --git a/src/Execution/ExecutionArguments.php b/src/Execution/ExecutionArguments.php index 048eee7e..e4ec93f1 100644 --- a/src/Execution/ExecutionArguments.php +++ b/src/Execution/ExecutionArguments.php @@ -29,7 +29,7 @@ class ExecutionArguments protected $contextValue; /** - * @var [] + * @var array */ protected $variableValues; @@ -49,18 +49,18 @@ class ExecutionArguments * @param DocumentNode $document * @param mixed $rootValue * @param mixed $contextValue - * @param $variableValues + * @param array $variableValues * @param OperationDefinitionNode $operation * @param mixed $fieldResolver */ public function __construct( Schema $schema, DocumentNode $document, - mixed $rootValue, - mixed $contextValue, - $variableValues, + $rootValue, + $contextValue, + array $variableValues, OperationDefinitionNode $operation, - mixed $fieldResolver + $fieldResolver ) { $this->schema = $schema; $this->document = $document; diff --git a/src/Language/AST/Schema/DefinitionBuilder.php b/src/Language/AST/Schema/DefinitionBuilder.php index de62a251..39092967 100644 --- a/src/Language/AST/Schema/DefinitionBuilder.php +++ b/src/Language/AST/Schema/DefinitionBuilder.php @@ -28,6 +28,7 @@ use Digia\GraphQL\Type\Definition\ScalarType; use Digia\GraphQL\Type\Definition\TypeInterface; use Digia\GraphQL\Type\Definition\UnionType; +use function Digia\GraphQL\Type\introspectionTypes; use Psr\SimpleCache\CacheInterface; use function Digia\GraphQL\Execution\getDirectiveValues; use function Digia\GraphQL\Language\valueFromAST; @@ -76,7 +77,7 @@ public function __construct(callable $resolveTypeFunction, CacheInterface $cache $this->resolveTypeFunction = $resolveTypeFunction; $builtInTypes = keyMap( - array_merge(specifiedScalarTypes()/*, introspectionTypes()*/), + array_merge(specifiedScalarTypes(), introspectionTypes()), function (NamedTypeInterface $type) { return $type->getName(); } diff --git a/src/Language/Parser.php b/src/Language/Parser.php index 53fd6394..2d99875c 100644 --- a/src/Language/Parser.php +++ b/src/Language/Parser.php @@ -173,7 +173,7 @@ protected function expectKeyword(LexerInterface $lexer, string $value): Token return $token; } - throw new SyntaxError(sprintf('Expected %s, found ${getTokenDesc(token)}', $value, $token)); + throw new SyntaxError(sprintf('Expected %s, found %s', $value, $token)); } /**