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