Move custom libs to the source tree
This commit is contained in:
15
libs/SimpleValidator/Validators/NotInArray.php
Normal file
15
libs/SimpleValidator/Validators/NotInArray.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace SimpleValidator\Validators;
|
||||
|
||||
class NotInArray extends InArray
|
||||
{
|
||||
public function execute(array $data)
|
||||
{
|
||||
if ($this->isFieldNotEmpty($data)) {
|
||||
return ! in_array($data[$this->field], $this->array);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user