Skip to content

Commit 89a82c2

Browse files
committed
fix: phpstan errors (ignore env outside config rule)
1 parent 3c5e322 commit 89a82c2

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

phpstan.neon.dist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ parameters:
66
paths:
77
- src
88
- config
9-
- database
109
tmpDir: build/phpstan
1110
checkOctaneCompatibility: true
1211
checkModelProperties: true
12+
ignoreErrors:
13+
- '#outside of the config directory which returns null when the config is cached#'

src/Http/Controllers/ImageTransformerController.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ public function __invoke(Request $request, string $options, string $path)
3838

3939
if (File::exists($cachePath)) {
4040
if (Cache::has('image-transform-url:'.$cachePath)) {
41-
return response(File::get($cachePath), 200, [
42-
'Content-Type' => File::mimeType($cachePath),
43-
'X-Cache' => 'HIT',
44-
]);
41+
return response(File::get($cachePath), 200, [
42+
'Content-Type' => File::mimeType($cachePath),
43+
'X-Cache' => 'HIT',
44+
]);
4545
} else {
4646
// Cache expired, delete the cache file and continue
4747
File::delete($cachePath);
@@ -101,7 +101,7 @@ public function __invoke(Request $request, string $options, string $path)
101101
$cacheDir = dirname($cachePath);
102102

103103
File::ensureDirectoryExists($cacheDir);
104-
File::put($cachePath, $encoded);
104+
File::put($cachePath, $encoded->toString());
105105

106106
Cache::put(
107107
key: 'image-transform-url:'.$cachePath,
@@ -111,7 +111,7 @@ public function __invoke(Request $request, string $options, string $path)
111111
});
112112
}
113113

114-
return response($encoded, 200, [
114+
return response($encoded->toString(), 200, [
115115
'Content-Type' => $encoded->mimetype(),
116116
...(config()->boolean('image-transform-url.cache.enabled') ? [
117117
'X-Cache' => 'MISS',

0 commit comments

Comments
 (0)