Example #1
0
 /**
  * Parameter processing entry point.
  * Processes the parameter. This includes parsing, validation and additional formatting.
  *
  * @since 1.0
  *
  * @param $definitions array of IParamDefinition
  * @param $params array of IParam
  * @param Options $options
  *
  * @throws Exception
  */
 public function process(array &$definitions, array $params, Options $options)
 {
     if ($this->setCount == 0) {
         if ($this->definition->isRequired()) {
             // This should not occur, so throw an exception.
             throw new Exception('Attempted to validate a required parameter without first setting a value.');
         } else {
             $this->setToDefault();
         }
     } else {
         $this->parseAndValidate($options);
     }
     if (!$this->hasFatalError() && ($this->definition->shouldManipulateDefault() || !$this->wasSetToDefault())) {
         $this->definition->format($this, $definitions, $params);
     }
 }