'title' =>
$not_blank_constraints,
'project' =>
$not_blank_constraints,
'type' =>
$not_blank_constraints,
'link' =>
$not_blank_constraints,
'is_psa' =>
new Choice(['choices' =>
[1, '1', 0, '0', TRUE, FALSE
]]),
'insecure' =>
new Type(['type' => 'array'
]),
],
// Allow unknown fields, in the case that new fields are added to JSON
// feed validation should still pass.
'allowExtraFields' => TRUE,
]);
$violations = Validation::
createValidator()->
validate($data,
$collection_constraint);
if ($violations->
count()) { foreach ($violations as $violation) { $violation_messages[] = "Field " .
$violation->
getPropertyPath() . ": " .
$violation->
getMessage();
} throw new \
UnexpectedValueException('Malformed security advisory: ' .
implode(",\n",
$violation_messages));
} } /**
* Gets the title.
*
* @return string
* The project title.
*/