Skip to content

Commit b2acd6e

Browse files
committed
phpstan: improve
1 parent ba5501c commit b2acd6e

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

src/BoostServiceProvider.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,6 @@ private function registerRoutes(): void
126126
/**
127127
* Build a string message for the log based on various input types. Single-dimensional, and multi:
128128
* "data": {"message":"Unhandled Promise Rejection","reason":{"name":"TypeError","message":"NetworkError when attempting to fetch resource.","stack":""}}]
129-
*
130-
* @param array $data
131-
* @return string
132129
*/
133130
private function buildLogMessageFromData(array $data): string
134131
{
@@ -141,6 +138,7 @@ private function buildLogMessageFromData(array $data): string
141138
is_bool($value) => $value ? 'true' : 'false',
142139
is_null($value) => 'null',
143140
is_object($value) => json_encode($value),
141+
default => $value,
144142
};
145143
}
146144

src/Install/Contracts/DetectionStrategy.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ interface DetectionStrategy
1111
/**
1212
* Detect if the application is installed on the machine.
1313
*
14-
* @param array{command:string, ?files:array<string>, ?paths:array<string>} $config
15-
* @param ?Platform $platform
16-
* @return bool
14+
* @param array{command?:string, basePath?:string, files?:array<string>, paths?:array<string>} $config
1715
*/
1816
public function detect(array $config, ?Platform $platform = null): bool;
1917
}

src/Middleware/InjectBoost.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function handle(Request $request, Closure $next): Response
2222
$injectedContent = $this->injectScript($response->getContent());
2323
$response->setContent($injectedContent);
2424

25-
if ($originalView instanceof View) {
25+
if ($originalView instanceof View && property_exists($response, 'original')) {
2626
$response->original = $originalView;
2727
}
2828
}

0 commit comments

Comments
 (0)