@@ -30,7 +30,7 @@ class Dispatcher
3030 /**
3131 * @var null|string
3232 */
33- private $ cachedFile ;
33+ private $ cacheFile ;
3434
3535 /**
3636 * @var array
@@ -43,11 +43,11 @@ class Dispatcher
4343 FastRoute \Dispatcher::NOT_FOUND => 404
4444 ];
4545
46- public function __construct (array $ routes , int $ defaultReturnType , ?string $ cachedFile )
46+ public function __construct (array $ routes , int $ defaultReturnType , ?string $ cacheFile )
4747 {
4848 $ this ->routes = $ routes ;
4949 $ this ->defaultReturnType = $ defaultReturnType ;
50- $ this ->cachedFile = $ cachedFile ;
50+ $ this ->cacheFile = $ cacheFile ;
5151 }
5252
5353 /*
@@ -56,7 +56,7 @@ public function __construct(array $routes, int $defaultReturnType, ?string $cac
5656 public function dispatcher () : FastRoute \Dispatcher
5757 {
5858 $ this ->setRouteClosures ();
59- if ($ this ->cachedFile !== null && file_exists ($ this ->cachedFile )) {
59+ if ($ this ->cacheFile !== null && file_exists ($ this ->cacheFile )) {
6060 return $ this ->cachedDispatcher ();
6161 }
6262 /**
@@ -73,20 +73,20 @@ public function dispatcher() : FastRoute\Dispatcher
7373
7474 private function createCachedRoute ($ routeCollector ) : void
7575 {
76- if ($ this ->cachedFile !== null && !file_exists ($ this ->cachedFile )) {
76+ if ($ this ->cacheFile !== null && !file_exists ($ this ->cacheFile )) {
7777 /**
7878 * @var FastRoute\RouteCollector $routeCollector
7979 */
8080 $ dispatchData = $ routeCollector ->getData ();
81- file_put_contents ($ this ->cachedFile , '<?php return ' . var_export ($ dispatchData , true ) . '; ' , LOCK_EX );
81+ file_put_contents ($ this ->cacheFile , '<?php return ' . var_export ($ dispatchData , true ) . '; ' , LOCK_EX );
8282 }
8383 }
8484
8585 private function cachedDispatcher () : FastRoute \Dispatcher \GroupCountBased
8686 {
87- $ dispatchData = include $ this ->cachedFile ;
87+ $ dispatchData = require $ this ->cacheFile ;
8888 if (!is_array ($ dispatchData )) {
89- throw new InvalidCacheFileException ('Invalid cache file " ' . $ this ->cachedFile . '" ' );
89+ throw new InvalidCacheFileException ('Invalid cache file " ' . $ this ->cacheFile . '" ' );
9090 }
9191 return new FastRoute \Dispatcher \GroupCountBased ($ dispatchData );
9292 }
0 commit comments