File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,13 +67,7 @@ public static function bootSushi()
6767 static ::setSqliteConnection ($ cachePath );
6868 },
6969 'cache-file-not-found-or-stale ' => function () use ($ cachePath , $ dataPath , $ instance ) {
70- file_put_contents ($ cachePath , '' );
71-
72- static ::setSqliteConnection ($ cachePath );
73-
74- $ instance ->migrate ();
75-
76- touch ($ cachePath , filemtime ($ dataPath ));
70+ static ::cacheFileNotFoundOrStale ($ cachePath , $ dataPath , $ instance );
7771 },
7872 'no-caching-capabilities ' => function () use ($ instance ) {
7973 static ::setSqliteConnection (':memory: ' );
@@ -101,6 +95,17 @@ public static function bootSushi()
10195 }
10296 }
10397
98+ protected static function cacheFileNotFoundOrStale ($ cachePath , $ dataPath , $ instance )
99+ {
100+ file_put_contents ($ cachePath , '' );
101+
102+ static ::setSqliteConnection ($ cachePath );
103+
104+ $ instance ->migrate ();
105+
106+ touch ($ cachePath , filemtime ($ dataPath ));
107+ }
108+
104109 protected function newRelatedInstance ($ class )
105110 {
106111 return tap (new $ class , function ($ instance ) {
You can’t perform that action at this time.
0 commit comments