/** * @param string $type * @return NullFilter|Filter */ public function getFilter($type) { try { return parent::getFilter($type); } catch (\InvalidArgumentException $e) { return new NullFilter(); } }
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; }