private String processReturnType(MethodDeclaration methodDeclaration) { PHPMethodDeclaration phpMethodDeclaration = (PHPMethodDeclaration) methodDeclaration; PHPDocBlock docBlock = phpMethodDeclaration.getPHPDoc(); String type = VOID_RETURN_TYPE; if (phpMethodDeclaration.getReturnType() != null) { return phpMethodDeclaration.getReturnType().getName(); } else if (docBlock != null) { for (PHPDocTag tag : docBlock.getTags(PHPDocTag.RETURN)) { if (tag.getTypeReferences().size() > 0) { return PHPModelUtils.appendTypeReferenceNames(tag.getTypeReferences()); } } } return type; }
public boolean visit(PHPMethodDeclaration s) throws Exception { Map<String, String> parameters = createInitialParameters(s); parameters.put("name", s.getName()); xmlWriter.startTag("PHPMethodDeclaration", parameters); return true; }