@@ -44,13 +44,16 @@ public function testAnnotationsCacheWarmerWithDebugDisabled()
44
44
$ this ->assertFileExists ($ cacheFile );
45
45
46
46
// Assert cache is valid
47
- $ psr6Cache = new PhpArrayAdapter ($ cacheFile , new NullAdapter ());
48
- if (class_exists (PsrCachedReader::class)) {
49
- $ reader = new PsrCachedReader ($ this ->getReadOnlyReader (), $ psr6Cache );
50
- } else {
51
- $ reader = new CachedReader ($ this ->getReadOnlyReader (), new DoctrineProvider ($ psr6Cache ));
52
- }
53
-
47
+ $ reader = class_exists (PsrCachedReader::class)
48
+ ? new PsrCachedReader (
49
+ $ this ->getReadOnlyReader (),
50
+ new PhpArrayAdapter ($ cacheFile , new NullAdapter ())
51
+ )
52
+ : new CachedReader (
53
+ $ this ->getReadOnlyReader (),
54
+ new DoctrineProvider (new PhpArrayAdapter ($ cacheFile , new NullAdapter ()))
55
+ )
56
+ ;
54
57
$ refClass = new \ReflectionClass ($ this );
55
58
$ reader ->getClassAnnotations ($ refClass );
56
59
$ reader ->getMethodAnnotations ($ refClass ->getMethod (__FUNCTION__ ));
@@ -67,13 +70,19 @@ public function testAnnotationsCacheWarmerWithDebugEnabled()
67
70
$ this ->assertFileExists ($ cacheFile );
68
71
69
72
// Assert cache is valid
70
- $ psr6Cache = new PhpArrayAdapter ($ cacheFile , new NullAdapter ());
71
- if (class_exists (PsrCachedReader::class)) {
72
- $ reader = new PsrCachedReader ($ this ->getReadOnlyReader (), $ psr6Cache );
73
- } else {
74
- $ reader = new CachedReader ($ this ->getReadOnlyReader (), new DoctrineProvider ($ psr6Cache ));
75
- }
76
-
73
+ $ phpArrayAdapter = new PhpArrayAdapter ($ cacheFile , new NullAdapter ());
74
+ $ reader = class_exists (PsrCachedReader::class)
75
+ ? new PsrCachedReader (
76
+ $ this ->getReadOnlyReader (),
77
+ $ phpArrayAdapter ,
78
+ true
79
+ )
80
+ : new CachedReader (
81
+ $ this ->getReadOnlyReader (),
82
+ new DoctrineProvider ($ phpArrayAdapter ),
83
+ true
84
+ )
85
+ ;
77
86
$ refClass = new \ReflectionClass ($ this );
78
87
$ reader ->getClassAnnotations ($ refClass );
79
88
$ reader ->getMethodAnnotations ($ refClass ->getMethod (__FUNCTION__ ));
0 commit comments