Skip to content

Commit

Permalink
Implement __debugInfo() for Origin::class
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Dec 16, 2024
1 parent 92bae6e commit ce30eb3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Origin.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public function __construct(
protected string $mediaType = 'application/octet-stream',
protected ?string $filePath = null
) {
//
}

/**
Expand Down Expand Up @@ -85,4 +86,17 @@ public function fileExtension(): ?string
{
return empty($this->filePath) ? null : pathinfo($this->filePath, PATHINFO_EXTENSION);
}

/**
* Show debug info for the current image
*
* @return array<string, null|string>
*/
public function __debugInfo(): array
{
return [
'mediaType' => $this->mediaType(),
'filePath' => $this->filePath(),
];
}
}

0 comments on commit ce30eb3

Please sign in to comment.