for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace BrenoRoosevelt\Validation\Rules;
use Attribute;
use BrenoRoosevelt\Validation\AbstractRule;
use BrenoRoosevelt\Validation\StopSign;
#[Attribute(Attribute::TARGET_PROPERTY)]
class NotEmptyString extends AbstractRule
{
const MESSAGE = 'This value cannot be left blank';
public function __construct(
?string $message = self::MESSAGE,
int $stopOnFailure = StopSign::DONT_STOP
) {
parent::__construct($message, $stopOnFailure);
}
public function isValid($input, array $context = []): bool
return !(new EmptyString)->isValid($input, $context);