29 lines
496 B
PHP
29 lines
496 B
PHP
![]() |
<?php
|
||
|
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 '';
|
||
|
}
|
||
|
}
|