Skip to content

Commit 90d715d

Browse files
committed
phpstan improvements
1 parent ee364b9 commit 90d715d

File tree

4 files changed

+3
-9
lines changed

4 files changed

+3
-9
lines changed

phpstan.neon.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ parameters:
33
- config
44
- src
55

6-
level: 8
6+
level: 5

src/Concerns/ReadsLogs.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,6 @@ private function scanLogChunkForEntries(string $logFile, int $chunkSize): array
121121
}
122122

123123
$content = stream_get_contents($handle);
124-
if ($content === false) {
125-
return [];
126-
}
127124

128125
// Split by beginning-of-entry look-ahead (PSR-3 timestamp pattern).
129126
$entries = preg_split(self::ENTRY_SPLIT_REGEX, $content, -1, PREG_SPLIT_NO_EMPTY);

src/Install/GuidelineWriter.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class GuidelineWriter
1717
public function __construct(protected Agent $agent) {}
1818

1919
/**
20-
* @return \Laravel\Boost\Install\GuidelineWriter::NEW|\Laravel\Boost\Install\GuidelineWriter::REPLACED|\Laravel\Boost\Install\GuidelineWriter::FAILED\Laravel\Boost\Install\GuidelineWriter::NOOP
20+
* @return \Laravel\Boost\Install\GuidelineWriter::NEW|\Laravel\Boost\Install\GuidelineWriter::REPLACED|\Laravel\Boost\Install\GuidelineWriter::FAILED|\Laravel\Boost\Install\GuidelineWriter::NOOP
2121
*/
2222
public function write(string $guidelines): int
2323
{
@@ -43,9 +43,6 @@ public function write(string $guidelines): int
4343
$this->acquireLockWithRetry($handle, $filePath);
4444

4545
$content = stream_get_contents($handle);
46-
if ($content === false) {
47-
throw new \RuntimeException("Failed to read file content: {$filePath}");
48-
}
4946

5047
// Check if guidelines already exist
5148
$pattern = '/<laravel-boost-guidelines>.*?<\/laravel-boost-guidelines>/s';

src/Mcp/Tools/ApplicationInfo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ private function discoverModels(): array
5454
$appPath = app_path();
5555

5656
if (! is_dir($appPath)) {
57-
return ['app-path-isnt-a-directory:'.$appPath];
57+
return ['app-path-isnt-a-directory' => $appPath];
5858
}
5959

6060
$finder = Finder::create()

0 commit comments

Comments
 (0)