type === self::TYPE_SUCCESS; } public function isSkipped(): bool { return $this->type === self::TYPE_SKIPPED; } public function isError(): bool { return $this->type === self::TYPE_ERROR; } public function isValid(): bool { return $this->isSuccess() || $this->isSkipped(); } public function __toString(): string { $type = match ($this->type) { self::TYPE_SUCCESS => 'Success', self::TYPE_ERROR => 'Error', self::TYPE_SKIPPED => 'Skipped', default => throw new Exception('Invalid type'), }; $str = $type . ': ' . $this->path; return $this->isError() ? $str . ' - ' . $this->error : $str; } }