/** * Resolves the type from the @property tag * * @param variableName * @param docTag * @return the type of the given variable */ private String getTypeBinding(String variableName, PHPDocTag docTag) { final String[] split = docTag.getValue().trim().split("\\s+"); // $NON-NLS-1$ if (split.length < 2) { return null; } return split[1].equals(variableName) ? split[0] : null; }
protected void resolveMagicClassVariableDeclaration( String variableName, IType type, IModelAccessCache cache) { final PHPDocBlock docBlock = PHPModelUtils.getDocBlock(type); if (docBlock != null) { for (PHPDocTag tag : docBlock.getTags()) { final int tagKind = tag.getTagKind(); if (tagKind == PHPDocTag.PROPERTY || tagKind == PHPDocTag.PROPERTY_READ || tagKind == PHPDocTag.PROPERTY_WRITE) { final String typeName = getTypeBinding(variableName, tag); if (typeName != null) { IEvaluatedType resolved = PHPSimpleTypes.fromString(typeName); if (resolved == null) { resolved = new PHPClassType(typeName); } evaluated.add(resolved); } } } } }