Skip to content

Commit

Permalink
Improve type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianfeldmann committed Jan 9, 2025
1 parent c19e8c4 commit 3e212ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Storage/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class File
*
* @var string
*/
protected $path;
protected string $path;

/**
* File constructor.
Expand Down
3 changes: 2 additions & 1 deletion src/Storage/File/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use CaptainHook\App\Storage\File;
use RuntimeException;
use stdClass;

/**
* Class Json
Expand All @@ -30,7 +31,7 @@ final class Json extends File
* @param bool $assoc
* @return \stdClass|array<string, mixed>|null
*/
public function read(bool $assoc = false)
public function read(bool $assoc = false): array|stdClass|null
{
$json = json_decode(parent::read(), $assoc);
if (json_last_error() !== JSON_ERROR_NONE) {
Expand Down

0 comments on commit 3e212ac

Please sign in to comment.