2019-12-07 17:31:38 +08:00
|
|
|
<?php
|
2020-11-29 09:29:14 +08:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2019-12-07 17:31:38 +08:00
|
|
|
namespace catcher\validates;
|
|
|
|
|
|
|
|
class Sometimes implements ValidateInterface
|
|
|
|
{
|
|
|
|
|
|
|
|
public function type(): string
|
|
|
|
{
|
|
|
|
// TODO: Implement type() method.
|
|
|
|
return 'sometimes';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function verify($value): bool
|
|
|
|
{
|
|
|
|
// TODO: Implement verify() method.
|
|
|
|
if ($value) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function message(): string
|
|
|
|
{
|
|
|
|
// TODO: Implement message() method.
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
}
|