This commit is contained in:
Hide_D committed 2022-01-24 03:22:03 +09:00
1 parent d75f21035d
commit 290e7ee05e
34 files changed
+1936 -8

No files matched your search

@@ -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,
);
}
}