11<?php
22
33
4- namespace TheCodingMachine \Graphqlite \Bundle \DependencyInjection ;
4+ namespace TheCodingMachine \GraphQLite \Bundle \DependencyInjection ;
55
66
7+ use GraphQL \Error \DebugFlag ;
78use TheCodingMachine \GraphQLite \Mappers \Root \RootTypeMapperFactoryInterface ;
89use function array_map ;
9- use GraphQL \Error \Debug ;
1010use GraphQL \Server \ServerConfig ;
1111use GraphQL \Type \Definition \ObjectType ;
12- use function implode ;
13- use function is_dir ;
14- use Mouf \Composer \ClassNameMapper ;
1512use function rtrim ;
1613use Symfony \Component \Config \FileLocator ;
1714use Symfony \Component \DependencyInjection \ContainerBuilder ;
18- use Symfony \Component \DependencyInjection \Definition ;
1915use Symfony \Component \DependencyInjection \Extension \Extension ;
2016use Symfony \Component \DependencyInjection \Loader \XmlFileLoader ;
21- use TheCodingMachine \GraphQLite \GraphQLRuntimeException as GraphQLException ;
22- use function var_dump ;
2317
24- class GraphqliteExtension extends Extension
18+ class GraphQLiteExtension extends Extension
2519{
2620
21+ public function getAlias ()
22+ {
23+ return 'graphqlite ' ;
24+ }
25+
2726 /**
2827 * Loads a specific configuration.
2928 *
@@ -84,9 +83,9 @@ function($namespace): string {
8483 if (isset ($ config ['debug ' ])) {
8584 $ debugCode = $ this ->toDebugCode ($ config ['debug ' ]);
8685 } else {
87- $ debugCode = Debug ::RETHROW_UNSAFE_EXCEPTIONS ;
86+ $ debugCode = DebugFlag ::RETHROW_UNSAFE_EXCEPTIONS ;
8887 }
89- $ definition ->addMethodCall ('setDebug ' , [$ debugCode ]);
88+ $ definition ->addMethodCall ('setDebugFlag ' , [$ debugCode ]);
9089
9190 $ container ->registerForAutoconfiguration (ObjectType::class)
9291 ->addTag ('graphql.output_type ' );
@@ -101,10 +100,10 @@ function($namespace): string {
101100 private function toDebugCode (array $ debug ): int
102101 {
103102 $ code = 0 ;
104- $ code |= ($ debug ['INCLUDE_DEBUG_MESSAGE ' ] ?? 0 )*Debug ::INCLUDE_DEBUG_MESSAGE ;
105- $ code |= ($ debug ['INCLUDE_TRACE ' ] ?? 0 )*Debug ::INCLUDE_TRACE ;
106- $ code |= ($ debug ['RETHROW_INTERNAL_EXCEPTIONS ' ] ?? 0 )*Debug ::RETHROW_INTERNAL_EXCEPTIONS ;
107- $ code |= ($ debug ['RETHROW_UNSAFE_EXCEPTIONS ' ] ?? 0 )*Debug ::RETHROW_UNSAFE_EXCEPTIONS ;
103+ $ code |= ($ debug ['INCLUDE_DEBUG_MESSAGE ' ] ?? 0 )*DebugFlag ::INCLUDE_DEBUG_MESSAGE ;
104+ $ code |= ($ debug ['INCLUDE_TRACE ' ] ?? 0 )*DebugFlag ::INCLUDE_TRACE ;
105+ $ code |= ($ debug ['RETHROW_INTERNAL_EXCEPTIONS ' ] ?? 0 )*DebugFlag ::RETHROW_INTERNAL_EXCEPTIONS ;
106+ $ code |= ($ debug ['RETHROW_UNSAFE_EXCEPTIONS ' ] ?? 0 )*DebugFlag ::RETHROW_UNSAFE_EXCEPTIONS ;
108107 return $ code ;
109108 }
110109}
0 commit comments