/** * @param \EBT\ExtensionBuilder\Domain\Model\ClassObject\Method $method * @param array $replacements * @return void */ protected function updateMethodBody($method, $replacements) { $stmts = $method->getBodyStmts(); $stmts = current($this->parserService->replaceNodeProperty(array($stmts), $replacements, null, 'name')); $stmts = current($this->parserService->replaceNodeProperty(array($stmts), $replacements, null, 'value')); $method->setBodyStmts($stmts); }
/** * Replace all occurences of the old property name with the new name * * @param string $oldName * @param string $newName * @param string $string * * @return string */ protected function replacePropertyNameInMethodBody($oldName, $newName, $methodBodyStmts) { return $this->parserService->replaceNodeProperty($methodBodyStmts, array($oldName => $newName)); }