public function validate($value, ValidationResult $result = null)
{
if ($result === null) {
$result = new ValidationResult($value);
}
if (!is_file($value)) {
$result->addError(static::MSG_NOSUCHFILE);
return $result;
}
$rawJson = file_get_contents($value);
if (!@json_decode($rawJson)) {
$result->addError(static::MSG_NOTVALIDCONFIG);
return $result;
}
return $result;
}