This commit is contained in:
2022-02-05 07:43:27 +00:00
committed by Gitea
parent b26b8bdb98
commit 877d77f28b
34 changed files with 1936 additions and 8 deletions
@@ -0,0 +1,31 @@
<?php
namespace Spatie\DataTransferObject\Validation;
use JetBrains\PhpStorm\Immutable;
class ValidationResult
{
public function __construct(
#[Immutable]
public bool $isValid,
#[Immutable]
public ?string $message = null
) {
}
public static function valid(): self
{
return new self(
isValid: true,
);
}
public static function invalid(string $message): self
{
return new self(
isValid: false,
message: $message,
);
}
}