/** * @param Method $method * @param bool $stopPropagation * @return Method */ public function addMethod(Method $method = null, $stopPropagation = false) { if (is_null($method)) { $method = new Method(); } if (!$stopPropagation) { $method->setController($this, true); } $this->methods[] = $method; return $method; }