@@ -213,7 +213,8 @@ private static function classAnnotationsToGQLConfiguration(
213213 if ($ preProcess ) {
214214 self ::$ providers [] = ['metadata ' => $ graphClass , 'annotation ' => $ classAnnotation ];
215215 }
216- break ;
216+
217+ return [];
217218 }
218219
219220 if (null !== $ gqlType ) {
@@ -239,9 +240,7 @@ private static function classAnnotationsToGQLConfiguration(
239240 */
240241 private static function getGraphClass (string $ className ): GraphClass
241242 {
242- if (!isset (self ::$ graphClassCache [$ className ])) {
243- self ::$ graphClassCache [$ className ] = new GraphClass ($ className );
244- }
243+ self ::$ graphClassCache [$ className ] ??= new GraphClass ($ className );
245244
246245 return self ::$ graphClassCache [$ className ];
247246 }
@@ -302,7 +301,7 @@ private static function graphQLTypeConfigFromAnnotation(GraphClass $graphClass,
302301 $ typeConfiguration ['fields ' ] = array_merge ($ fieldsFromProperties , $ fieldsFromMethods );
303302 $ typeConfiguration = self ::getDescriptionConfiguration ($ graphClass ->getAnnotations ()) + $ typeConfiguration ;
304303
305- if ($ typeAnnotation ->interfaces ) {
304+ if (null !== $ typeAnnotation ->interfaces ) {
306305 $ typeConfiguration ['interfaces ' ] = $ typeAnnotation ->interfaces ;
307306 } else {
308307 $ typeConfiguration ['interfaces ' ] = array_keys (self ::searchClassesMapBy (function ($ gqlType , $ configuration ) use ($ graphClass ) {
@@ -435,7 +434,7 @@ private static function enumAnnotationToGQLConfiguration(GraphClass $graphClass,
435434 private static function unionAnnotationToGQLConfiguration (GraphClass $ graphClass , GQL \Union $ unionAnnotation ): array
436435 {
437436 $ unionConfiguration = [];
438- if ($ unionAnnotation ->types ) {
437+ if (null !== $ unionAnnotation ->types ) {
439438 $ unionConfiguration ['types ' ] = $ unionAnnotation ->types ;
440439 } else {
441440 $ types = array_keys (self ::searchClassesMapBy (function ($ gqlType , $ configuration ) use ($ graphClass ) {
@@ -550,6 +549,7 @@ private static function getTypeFieldConfigurationFromReflector(GraphClass $graph
550549 } else {
551550 if (!$ fieldType ) {
552551 if ($ isMethod ) {
552+ /** var ReflectionMethod $reflector */
553553 if ($ reflector ->hasReturnType ()) {
554554 try {
555555 $ fieldConfiguration ['type ' ] = self ::resolveGraphQLTypeFromReflectionType ($ reflector ->getReturnType (), self ::VALID_OUTPUT_TYPES );
0 commit comments