public function validate($value, ValidationResult $result = null)
{
if ($result === null) {
$result = new ValidationResult($value);
}
// the $value must be a valid environment name, but it's ok if it doesn't
// exist if it's the default env as we might not have created it yet
if (!$this->deviceList->hasEntry($value)) {
$result->addError(static::MSG_NOTVALIDDEVICE);
return $result;
}
return $result;
}