56
56
*/
57
57
class GraphQLiteCompilerPass implements CompilerPassInterface
58
58
{
59
- /**
60
- * @var AnnotationReader|null
61
- */
62
- private $ annotationReader ;
59
+ private ?AnnotationReader $ annotationReader = null ;
60
+
61
+ private string $ cacheDir ;
62
+
63
+ private ?CacheInterface $ cache = null ;
64
+
65
+ private ?ClassBoundCacheContractInterface $ codeCache = null ;
63
66
64
- /**
65
- * @var string
66
- */
67
- private $ cacheDir ;
68
67
69
68
/**
70
69
* You can modify the container here before it is dumped to PHP code.
@@ -317,9 +316,6 @@ private function registerController(string $controllerClassName, ContainerBuilde
317
316
318
317
/**
319
318
* Register a method call on SchemaFactory for each tagged service, passing the service in parameter.
320
- *
321
- * @param string $tag
322
- * @param string $methodName
323
319
*/
324
320
private function mapAdderToTag (string $ tag , string $ methodName , ContainerBuilder $ container , Definition $ schemaFactory ): void
325
321
{
@@ -371,8 +367,6 @@ private function makePublicInjectedServices(ReflectionClass $refClass, Annotatio
371
367
}
372
368
373
369
/**
374
- * @param ReflectionMethod $method
375
- * @param ContainerBuilder $container
376
370
* @return array<string, string> key = value = service name
377
371
*/
378
372
private function getListOfInjectedServices (ReflectionMethod $ method , ContainerBuilder $ container ): array
@@ -412,7 +406,6 @@ private function getListOfInjectedServices(ReflectionMethod $method, ContainerBu
412
406
}
413
407
414
408
/**
415
- * @param ReflectionMethod $method
416
409
* @return array<string, ReflectionParameter>
417
410
*/
418
411
private static function getParametersByName (ReflectionMethod $ method ): array
@@ -433,11 +426,6 @@ private function getAnnotationReader(): AnnotationReader
433
426
return $ this ->annotationReader ??= new AnnotationReader ();
434
427
}
435
428
436
- /**
437
- * @var CacheInterface
438
- */
439
- private $ cache ;
440
-
441
429
private function getPsr16Cache (): CacheInterface
442
430
{
443
431
if ($ this ->cache === null ) {
@@ -447,27 +435,21 @@ private function getPsr16Cache(): CacheInterface
447
435
$ this ->cache = new Psr16Cache (new PhpFilesAdapter ('graphqlite_bundle ' , 0 , $ this ->cacheDir ));
448
436
}
449
437
}
438
+
450
439
return $ this ->cache ;
451
440
}
452
441
453
- /**
454
- * @var ClassBoundCacheContractInterface
455
- */
456
- private $ codeCache ;
457
-
458
442
private function getCodeCache (): ClassBoundCacheContractInterface
459
443
{
460
- if ($ this ->codeCache === null ) {
461
- $ this ->codeCache = new ClassBoundCacheContract (new ClassBoundMemoryAdapter (new ClassBoundCache (new FileBoundCache ($ this ->getPsr16Cache ()))));
462
- }
463
- return $ this ->codeCache ;
444
+ return $ this ->codeCache ??= new ClassBoundCacheContract (
445
+ new ClassBoundMemoryAdapter (new ClassBoundCache (new FileBoundCache ($ this ->getPsr16Cache ())))
446
+ );
464
447
}
465
448
466
449
/**
467
450
* Returns the array of globbed classes.
468
451
* Only instantiable classes are returned.
469
452
*
470
- * @param string $namespace
471
453
* @return Generator<class-string, ReflectionClass<object>, void, void>
472
454
*/
473
455
private function getClassList (string $ namespace ): Generator
0 commit comments