/** * @param FunctionDeclarationNode|ClassMethodNode|InterfaceMethodNode $node */ protected function handleParameterWrapping($node) { $parameter_list = $node->getParameterList(); $parameter_wrapped = $parameter_list->children(Filter::isNewline())->isNotEmpty(); if ($parameter_wrapped) { $this->newlineAfter($parameter_list); if (!$node instanceof InterfaceMethodNode && $node->getBody()) { $this->spaceBefore($node->getBody()); } } }
/** * Adds a method to interface. * * @param InterfaceMethodNode|string $method * The method to append. Can either be an existing method, or a string (a * new public method will be created with that name). * * @return $this */ public function appendMethod($method) { if (is_string($method)) { $method = InterfaceMethodNode::create($method); } $this->statements->lastChild()->before($method); FormatterFactory::format($this); return $this; }