Example #1
0
 private function validateParameterValues(array $parameterValues, InstallerDescriptor $installerDescriptor)
 {
     $validator = new InstallerParameterValidator();
     $violations = $validator->validate($parameterValues, $installerDescriptor);
     foreach ($violations as $violation) {
         switch ($violation->getCode()) {
             case ConstraintViolation::MISSING_PARAMETER:
                 throw NotInstallableException::missingParameter($violation->getParameterName(), $violation->getInstallerName());
             case ConstraintViolation::NO_SUCH_PARAMETER:
                 throw NotInstallableException::noSuchParameter($violation->getParameterName(), $violation->getInstallerName());
         }
     }
 }