mediaType; } /** * Alias of self::mediaType() */ public function mimetype(): string { return $this->mediaType(); } /** * Set media type of current instance */ public function setMediaType(string|MediaType $type): self { $this->mediaType = match (true) { is_string($type) => $type, default => $type->value, }; return $this; } /** * Return file path of origin */ public function filePath(): ?string { return $this->filePath; } /** * Set file path for origin */ public function setFilePath(string $path): self { $this->filePath = $path; return $this; } /** * Return file extension if origin was created from file path */ public function fileExtension(): ?string { return pathinfo($this->filePath ?: '', PATHINFO_EXTENSION) ?: null; } /** * Show debug info for the current image * * @return array */ public function __debugInfo(): array { return [ 'mediaType' => $this->mediaType(), 'filePath' => $this->filePath(), ]; } }