Esempio n. 1
0
 /**
  * @param string $type
  * @return NullFilter|Filter
  */
 public function getFilter($type)
 {
     try {
         return parent::getFilter($type);
     } catch (\InvalidArgumentException $e) {
         return new NullFilter();
     }
 }
Esempio n. 2
0
 private function filter(MethodAnalyzer $analyzer, $arguments)
 {
     $args = $analyzer->normalize($arguments);
     foreach ($args as $name => $value) {
         $type = $analyzer->getTypeHint($analyzer->getParameter($name));
         if ($type) {
             $args[$name] = $this->filters->getFilter($type)->filter($args[$name]);
         }
     }
     return $args;
 }