Files
animethemes-server/app/Actions/ActionResult.php
T
paranarimasu 80899b07df Delete video action (#444)
* feat(admin): remove video from storage

* style: fix StyleCI findings
2022-08-23 13:45:40 -05:00

54 lines
951 B
PHP

<?php
declare(strict_types=1);
namespace App\Actions;
use App\Enums\Actions\ActionStatus;
/**
* Class ActionResult.
*/
class ActionResult
{
/**
* Create a new action result instance.
*
* @param ActionStatus $status
* @param string|null $message
*/
public function __construct(protected readonly ActionStatus $status, protected readonly ?string $message = null)
{
}
/**
* Get the action result status.
*
* @return ActionStatus
*/
public function getStatus(): ActionStatus
{
return $this->status;
}
/**
* Get the action result message.
*
* @return string|null
*/
public function getMessage(): ?string
{
return $this->message;
}
/**
* Has the action failed?
*
* @return bool
*/
public function hasFailed(): bool
{
return ActionStatus::FAILED()->is($this->status);
}
}