@@ -25,17 +25,17 @@ |
||
25 | 25 | $this->validateConfig($config); |
26 | 26 | |
27 | 27 | // Bind things to the container |
28 | - $this->app->singleton(GraphQLService::class, function (Application $app) use ($config) { |
|
28 | + $this->app->singleton(GraphQLService::class, function(Application $app) use ($config) { |
|
29 | 29 | $processor = $config['processor'] ?? Processor::class; |
30 | 30 | |
31 | 31 | return new GraphQLService(new $processor(new $config['schema']), $app->make(CacheRepository::class)); |
32 | 32 | }); |
33 | 33 | |
34 | - $this->app->singleton(TypeResolverInterface::class, function () use ($config) { |
|
34 | + $this->app->singleton(TypeResolverInterface::class, function() use ($config) { |
|
35 | 35 | return new $config['type_resolver'](); |
36 | 36 | }); |
37 | 37 | |
38 | - $this->app->bind(GraphiQLTokenMiddleware::class, function () use ($config) { |
|
38 | + $this->app->bind(GraphiQLTokenMiddleware::class, function() use ($config) { |
|
39 | 39 | return new GraphiQLTokenMiddleware($config['enable_graphiql'], $config['graphiql_token'] ?? null); |
40 | 40 | }); |
41 | 41 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $request = new Request(); |
23 | 23 | } |
24 | 24 | |
25 | - $this->assertInstanceOf(Response::class, $middleware->handle($request, function () { |
|
25 | + $this->assertInstanceOf(Response::class, $middleware->handle($request, function() { |
|
26 | 26 | return new Response(); |
27 | 27 | })); |
28 | 28 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $request = new Request(); |
38 | 38 | } |
39 | 39 | |
40 | - $middleware->handle($request, function () { |
|
40 | + $middleware->handle($request, function() { |
|
41 | 41 | return new Response(); |
42 | 42 | }); |
43 | 43 |
@@ -93,17 +93,17 @@ |
||
93 | 93 | { |
94 | 94 | // Mock the processor |
95 | 95 | $processor = $this->getMockBuilder(Processor::class) |
96 | - ->disableOriginalConstructor() |
|
97 | - ->setMethods(['getResponseData', 'processPayload']) |
|
98 | - ->getMock(); |
|
96 | + ->disableOriginalConstructor() |
|
97 | + ->setMethods(['getResponseData', 'processPayload']) |
|
98 | + ->getMock(); |
|
99 | 99 | |
100 | 100 | $processor->expects($this->once()) |
101 | - ->method('processPayload') |
|
102 | - ->willReturn($processor); |
|
101 | + ->method('processPayload') |
|
102 | + ->willReturn($processor); |
|
103 | 103 | |
104 | 104 | $processor->expects($this->once()) |
105 | - ->method('getResponseData') |
|
106 | - ->willReturn($responseData); |
|
105 | + ->method('getResponseData') |
|
106 | + ->willReturn($responseData); |
|
107 | 107 | |
108 | 108 | /** @var \PHPUnit_Framework_MockObject_MockObject|GraphQLService $service */ |
109 | 109 | $service = $this->getMockBuilder(GraphQLService::class) |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | { |
32 | 32 | /** @var \PHPUnit_Framework_MockObject_MockObject|CacheRepository $cacheRepository */ |
33 | 33 | $this->cache = $this->getMockBuilder(CacheRepository::class) |
34 | - ->setMethods(['get', 'forever']) |
|
35 | - ->getMockForAbstractClass(); |
|
34 | + ->setMethods(['get', 'forever']) |
|
35 | + ->getMockForAbstractClass(); |
|
36 | 36 | |
37 | 37 | $this->processor = new Processor(new Schema()); |
38 | 38 | $this->service = new GraphQLService($this->processor, $this->cache); |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | public function testGetProcessor() |
43 | 43 | { |
44 | 44 | $this->cache->expects($this->any()) |
45 | - ->method('get') |
|
46 | - ->with(GraphQLService::PROCESSOR_CACHE_KEY) |
|
47 | - ->willReturn($this->processor); |
|
45 | + ->method('get') |
|
46 | + ->with(GraphQLService::PROCESSOR_CACHE_KEY) |
|
47 | + ->willReturn($this->processor); |
|
48 | 48 | |
49 | 49 | $this->assertEquals($this->processor, $this->service->getProcessor()); |
50 | 50 | } |
@@ -40,18 +40,18 @@ discard block |
||
40 | 40 | // Mock a NewRelic instance |
41 | 41 | /** @var \PHPUnit_Framework_MockObject_MockObject|Newrelic $newRelic */ |
42 | 42 | $newRelic = $this->getMockBuilder(Newrelic::class) |
43 | - ->setMethods(['noticeError']) |
|
44 | - ->getMock(); |
|
43 | + ->setMethods(['noticeError']) |
|
44 | + ->getMock(); |
|
45 | 45 | |
46 | 46 | $graphQLError = new GraphQLError('Some query', ['foo' => 'bar'], [new \Exception()]); |
47 | 47 | |
48 | 48 | $newRelic->expects($this->once()) |
49 | - ->method('noticeError') |
|
50 | - ->with(JsonEncoder::encode([ |
|
51 | - 'query' => $graphQLError->getQuery(), |
|
52 | - 'variables' => $graphQLError->getVariables(), |
|
53 | - 'message' => '', |
|
54 | - ]), $graphQLError->getExceptions()[0]); |
|
49 | + ->method('noticeError') |
|
50 | + ->with(JsonEncoder::encode([ |
|
51 | + 'query' => $graphQLError->getQuery(), |
|
52 | + 'variables' => $graphQLError->getVariables(), |
|
53 | + 'message' => '', |
|
54 | + ]), $graphQLError->getExceptions()[0]); |
|
55 | 55 | |
56 | 56 | // Create a request with errors |
57 | 57 | $request = new Request(); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | // Check again with no errors - nothing should get reported |
64 | 64 | $newRelic->expects($this->never()) |
65 | - ->method('noticeError'); |
|
65 | + ->method('noticeError'); |
|
66 | 66 | |
67 | 67 | $this->assertMiddlewarePasses($middleware); |
68 | 68 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | * |
21 | 21 | * @var string |
22 | 22 | */ |
23 | - public const INTROSPECTION_GRAPHQL = __DIR__ . '/../../resources/graphql/Introspection.graphql'; |
|
23 | + public const INTROSPECTION_GRAPHQL = __DIR__ . '/../../resources/graphql/Introspection.graphql'; |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * @var string |