You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
571 B
26 lines
571 B
<?php
|
|
|
|
namespace App\Models\Validation\Messages;
|
|
|
|
use App\Models\Validation\ValidationStatus;
|
|
|
|
class BaseMessages
|
|
{
|
|
protected array $messages;
|
|
|
|
public function __construct($messages)
|
|
{
|
|
$this->messages = $messages;
|
|
}
|
|
|
|
public function getMessage($status): string
|
|
{
|
|
return match($status)
|
|
{
|
|
ValidationStatus::FOUND => $this->messages['found'],
|
|
ValidationStatus::NOT_FOUND => $this->messages['not_found'],
|
|
ValidationStatus::INVALID_NAME => $this->messages['invalid_name'],
|
|
};
|
|
}
|
|
}
|