File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616
1717final class CacheExtension extends AbstractExtension
1818{
19- public function getTokenParsers ()
19+ public function getTokenParsers (): array
2020 {
2121 return [
2222 new CacheTokenParser (),
Original file line number Diff line number Diff line change @@ -78,11 +78,9 @@ public function __construct(CacheInterface $cache)
7878 $ this ->cache = $ cache ;
7979 }
8080
81- public function load ($ class )
81+ public function load (string $ class ): ? object
8282 {
83- if (CacheRuntime::class === $ class ) {
84- return new CacheRuntime ($ this ->cache );
85- }
83+ return CacheRuntime::class === $ class ? new CacheRuntime ($ this ->cache ) : null ;
8684 }
8785 });
8886
Original file line number Diff line number Diff line change @@ -30,11 +30,9 @@ protected function getRuntimeLoaders()
3030 {
3131 return [
3232 new class () implements RuntimeLoaderInterface {
33- public function load ($ class )
33+ public function load (string $ class ): ? object
3434 {
35- if (CacheRuntime::class === $ class ) {
36- return new CacheRuntime (new ArrayAdapter ());
37- }
35+ return CacheRuntime::class === $ class ? new CacheRuntime (new ArrayAdapter ()) : null ;
3836 }
3937 },
4038 ];
You can’t perform that action at this time.
0 commit comments