Skip to content
This repository was archived by the owner on Dec 9, 2023. It is now read-only.

Commit 5b66b48

Browse files
committed
PSR Fixes
1 parent d73f4a6 commit 5b66b48

File tree

6 files changed

+7
-18
lines changed

6 files changed

+7
-18
lines changed

src/Intervention/Image/ImageCache.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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

src/Intervention/Image/ImageCacheController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public function getImage($template, $filename)
5555
// build from filter template
5656
$image->make($path)->filter($template);
5757
}
58-
5958
}, config('imagecache.lifetime'));
6059

6160
return $this->buildResponse($content);
@@ -152,7 +151,7 @@ protected function buildResponse($content)
152151
// respond with 304 not modified if browser has the image cached
153152
$etag = md5($content);
154153
$not_modified = isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] == $etag;
155-
$content = $not_modified ? NULL : $content;
154+
$content = $not_modified ? null : $content;
156155
$status_code = $not_modified ? 304 : 200;
157156

158157
// return http response

src/Intervention/Image/Templates/Large.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ public function applyFilter(Image $image)
1111
{
1212
return $image->fit(480, 360);
1313
}
14-
}
14+
}

src/Intervention/Image/Templates/Medium.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ public function applyFilter(Image $image)
1111
{
1212
return $image->fit(240, 180);
1313
}
14-
}
14+
}

src/Intervention/Image/Templates/Small.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ public function applyFilter(Image $image)
1111
{
1212
return $image->fit(120, 90);
1313
}
14-
}
14+
}

tests/ImageCacheTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ public function emptyCacheDirectory()
1414
{
1515
$files = new \Illuminate\Filesystem\Filesystem;
1616

17-
foreach ($files->directories('storage/cache') as $directory)
18-
{
17+
foreach ($files->directories('storage/cache') as $directory) {
1918
$files->deleteDirectory($directory);
2019
}
2120
}
@@ -90,7 +89,7 @@ public function testChecksumWithClosure()
9089
$sum = 'e869cab5431815e67583b7c8cf3b657a';
9190
$img = new ImageCache;
9291
$img->canvas(300, 200, 'fff');
93-
$img->text('foo', 0, 0, function($font) {
92+
$img->text('foo', 0, 0, function ($font) {
9493
$font->valign('top');
9594
$font->size(32);
9695
});
@@ -100,7 +99,7 @@ public function testChecksumWithClosure()
10099
$sum = 'ec538f3194720c4657edde6af8145730';
101100
$img = new ImageCache;
102101
$img->canvas(300, 200, 'fff');
103-
$img->text('foo', 0, 0, function($font) {
102+
$img->text('foo', 0, 0, function ($font) {
104103
$font->valign('top');
105104
$font->size(30);
106105
});

0 commit comments

Comments
 (0)