for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Ubiquity\contents\validation\validators;
use Ubiquity\exceptions\ValidatorException;
use Ubiquity\utils\base\UString;
abstract class ValidatorHasNotNull extends Validator implements HasNotNullInterface{
protected $notNull;
public function validate($value) {
if ($this->notNull!==false && (null === $value || '' === $value)) {
return;
}
if (!UString::isValid($value)) {
throw new ValidatorException('This value can not be converted to string');