for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace AbterPhp\Framework\Validation\Rules;
use Countable;
use Opulence\Validation\Rules\IRule;
/**
* Defines the required rule
*/
class Forbidden implements IRule
{
* @inheritdoc
public function getSlug(): string
return 'forbidden';
}
public function passes($value, array $allValues = []): bool
if ($value === null) {
return true;
if (is_string($value) && $value === '') {
if ((is_array($value) || $value instanceof Countable) && count($value) === 0) {
return false;