public function validate(Context $context)
 {
     if (empty($context['normalized'])) {
         $context->throwError(400);
     }
     if (empty($this['server'])) {
         $context->throwError(400);
     }
     $this['port'] = $this['port'] ?: 80;
     $this['line'] = $this['server'] . ':' . $this['port'];
 }
Example #2
0
 public function validate(Context $context)
 {
     if (empty($this['name'])) {
         $context->throwError(400);
     }
     $this['listen'] = $this['listen'] ?: 80;
     $this['normalized'] = str_replace('.', '_', $this['name']);
 }