Skip to content

Commit

Permalink
Merge pull request #1205: Support Psalm v6, add PHP 8.4 in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
spiralbot committed Jan 31, 2025
1 parent 7b95470 commit 1c955de
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
},
"require-dev": {
"spiral/boot": "^3.16",
"phpunit/phpunit": "^10.5",
"mockery/mockery": "^1.6",
"vimeo/psalm": "^5.9"
"phpunit/phpunit": "^10.5.41",
"mockery/mockery": "^1.6.12",
"vimeo/psalm": "^6.0"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 2 additions & 1 deletion src/Engine/Native/NativeView.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function render(array $data = []): string
}
}

return \ob_get_clean();
$result = \ob_get_clean();
return $result === false ? '' : $result;
}
}
6 changes: 5 additions & 1 deletion src/ViewSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ public function getFilename(): string
*/
public function getCode(): string
{
return $this->code ?? \file_get_contents($this->getFilename());
$result = $this->code ?? \file_get_contents($this->getFilename());
$result === false and throw new \RuntimeException(
\sprintf('Unable to read file `%s`.', $this->getFilename()),
);
return $result;
}

/**
Expand Down

0 comments on commit 1c955de

Please sign in to comment.