@@ -58,7 +58,6 @@ public function __construct(ImageManager $manager = null, Cache $cache = null)
5858 $ this ->manager = $ manager ? $ manager : new ImageManager ;
5959
6060 if (is_null ($ cache )) {
61-
6261 // get laravel app
6362 $ app = function_exists ('app ' ) ? app () : null ;
6463
@@ -68,13 +67,10 @@ public function __construct(ImageManager $manager = null, Cache $cache = null)
6867 }
6968
7069 if (is_a ($ cache , 'Illuminate\Cache\CacheManager ' )) {
71-
7270 // add laravel cache and set custom cache_driver if persist
7371 $ cache_driver = config ('imagecache.cache_driver ' );
7472 $ this ->cache = $ cache_driver ? $ cache ->driver ($ cache_driver ) : $ cache ;
75-
7673 } else {
77-
7874 // define path in filesystem
7975 if (isset ($ manager ->config ['cache ' ]['path ' ])) {
8076 $ path = $ manager ->config ['cache ' ]['path ' ];
@@ -87,9 +83,7 @@ public function __construct(ImageManager $manager = null, Cache $cache = null)
8783 $ storage = new \Illuminate \Cache \FileStore ($ filesystem , $ path );
8884 $ this ->cache = new \Illuminate \Cache \Repository ($ storage );
8985 }
90-
9186 } else {
92-
9387 $ this ->cache = $ cache ;
9488 }
9589 }
@@ -301,7 +295,6 @@ public function get($lifetime = null, $returnObj = false)
301295
302296 // if imagedata exists in cache
303297 if ($ cachedImageData ) {
304-
305298 // transform into image-object
306299 if ($ returnObj ) {
307300 $ image = $ this ->manager ->make ($ cachedImageData );
@@ -311,9 +304,7 @@ public function get($lifetime = null, $returnObj = false)
311304
312305 // return raw data
313306 return $ cachedImageData ;
314-
315307 } else {
316-
317308 // process image data
318309 $ image = $ this ->process ();
319310
0 commit comments