Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
Rename GraphQLRuntime
Browse files Browse the repository at this point in the history
  • Loading branch information
crisu83 committed Mar 2, 2018
1 parent fed279c commit e05c7b2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions src/GraphQLRuntime.php → src/GraphQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@
use function Digia\GraphQL\Type\GraphQLScalarType;
use function Digia\GraphQL\Type\GraphQLString;

class GraphQLRuntime
class GraphQL
{

/**
* @var GraphQLRuntime
* @var GraphQL
*/
private static $instance;

Expand Down Expand Up @@ -122,7 +122,7 @@ private function __construct()
}

/**
* @return GraphQLRuntime
* @return GraphQL
*/
public static function getInstance()
{
Expand Down
8 changes: 4 additions & 4 deletions src/Type/directives.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

use Digia\GraphQL\GraphQLRuntime;
use Digia\GraphQL\GraphQL;
use Digia\GraphQL\Type\Definition\Directive;
use Digia\GraphQL\Type\Definition\DirectiveInterface;
use function Digia\GraphQL\Util\arraySome;
Expand All @@ -11,7 +11,7 @@
*/
function GraphQLIncludeDirective(): Directive
{
return GraphQLRuntime::get('GraphQLIncludeDirective');
return GraphQL::get('GraphQLIncludeDirective');
}

/**
Expand All @@ -20,7 +20,7 @@ function GraphQLIncludeDirective(): Directive
*/
function GraphQLSkipDirective(): Directive
{
return GraphQLRuntime::get('GraphQLSkipDirective');
return GraphQL::get('GraphQLSkipDirective');
}

const DEFAULT_DEPRECATION_REASON = 'No longer supported';
Expand All @@ -31,7 +31,7 @@ function GraphQLSkipDirective(): Directive
*/
function GraphQLDeprecatedDirective(): Directive
{
return GraphQLRuntime::get('GraphQLDeprecatedDirective');
return GraphQL::get('GraphQLDeprecatedDirective');
}

/**
Expand Down
12 changes: 6 additions & 6 deletions src/Type/scalars.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Digia\GraphQL\Type;

use Digia\GraphQL\GraphQLRuntime;
use Digia\GraphQL\GraphQL;
use Digia\GraphQL\Type\Definition\ScalarType;
use Digia\GraphQL\Type\Definition\TypeInterface;
use function Digia\GraphQL\Util\arraySome;
Expand All @@ -15,39 +15,39 @@
*/
function GraphQLBoolean(): ScalarType
{
return GraphQLRuntime::get('GraphQLBoolean');
return GraphQL::get('GraphQLBoolean');
}

/**
* @return ScalarType
*/
function GraphQLFloat(): ScalarType
{
return GraphQLRuntime::get('GraphQLFloat');
return GraphQL::get('GraphQLFloat');
}

/**
* @return ScalarType
*/
function GraphQLInt(): ScalarType
{
return GraphQLRuntime::get('GraphQLInt');
return GraphQL::get('GraphQLInt');
}

/**
* @return ScalarType
*/
function GraphQLID(): ScalarType
{
return GraphQLRuntime::get('GraphQLID');
return GraphQL::get('GraphQLID');
}

/**
* @return ScalarType
*/
function GraphQLString(): ScalarType
{
return GraphQLRuntime::get('GraphQLString');
return GraphQL::get('GraphQLString');
}

/**
Expand Down
14 changes: 7 additions & 7 deletions src/facades.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*/
function parse($source, array $options = []): NodeInterface
{
return GraphQLRuntime::get(ParserInterface::class)->parse(
GraphQLRuntime::get(LexerInterface::class)
return GraphQL::get(ParserInterface::class)->parse(
GraphQL::get(LexerInterface::class)
->setSource($source instanceof Source ? $source : new Source($source))
->setOptions($options)
);
Expand All @@ -34,8 +34,8 @@ function parse($source, array $options = []): NodeInterface
*/
function parseValue($source, array $options = []): NodeInterface
{
return GraphQLRuntime::get(ParserInterface::class)->parseValue(
GraphQLRuntime::get(LexerInterface::class)
return GraphQL::get(ParserInterface::class)->parseValue(
GraphQL::get(LexerInterface::class)
->setSource($source instanceof Source ? $source : new Source($source))
->setOptions($options)
);
Expand All @@ -50,8 +50,8 @@ function parseValue($source, array $options = []): NodeInterface
*/
function parseType($source, array $options = []): NodeInterface
{
return GraphQLRuntime::get(ParserInterface::class)->parseType(
GraphQLRuntime::get(LexerInterface::class)
return GraphQL::get(ParserInterface::class)->parseType(
GraphQL::get(LexerInterface::class)
->setSource($source instanceof Source ? $source : new Source($source))
->setOptions($options)
);
Expand All @@ -63,5 +63,5 @@ function parseType($source, array $options = []): NodeInterface
*/
function printNode(NodeInterface $node): string
{
return GraphQLRuntime::getInstance()->get(PrinterInterface::class)->print($node);
return GraphQL::getInstance()->get(PrinterInterface::class)->print($node);
}

0 comments on commit e05c7b2

Please sign in to comment.