mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-16 13:07:14 +01:00
52 lines
884 B
PHP
52 lines
884 B
PHP
|
<?php
|
||
|
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
namespace Xentral\Modules\MandatoryFields\Data;
|
||
|
|
||
|
final class ValidatorResultData
|
||
|
{
|
||
|
/** @var bool $isError */
|
||
|
private $isError;
|
||
|
|
||
|
/** @var string $message */
|
||
|
private $message;
|
||
|
|
||
|
/**
|
||
|
* @param bool $isError
|
||
|
* @param string $message
|
||
|
*/
|
||
|
public function __construct(bool $isError, string $message)
|
||
|
{
|
||
|
$this->isError = $isError;
|
||
|
$this->message = $message;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return bool
|
||
|
*/
|
||
|
public function isError(): bool
|
||
|
{
|
||
|
return $this->isError;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return string
|
||
|
*/
|
||
|
public function getMessage(): string
|
||
|
{
|
||
|
return $this->message;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return array
|
||
|
*/
|
||
|
public function toArray(): array
|
||
|
{
|
||
|
return [
|
||
|
'error' => $this->isError,
|
||
|
'message' => $this->message,
|
||
|
];
|
||
|
}
|
||
|
}
|