Examples of PHPType


Examples of com.jetbrains.php.lang.psi.resolve.types.PhpType

            }

            String propertyName = field.getName();

            // private $isNillable = false;
            PhpType type = field.getType();
            if(type.toString().equals("bool")) {
                completionResultSet.addElement(new PhpAnnotationPropertyLookupElement(new AnnotationProperty(propertyName, AnnotationPropertyEnum.BOOLEAN)));
                return;
            }

            // private $isNillable = array();
            if(type.toString().equals("array")) {
                completionResultSet.addElement(new PhpAnnotationPropertyLookupElement(new AnnotationProperty(propertyName, AnnotationPropertyEnum.ARRAY)));
                return;
            }

            PhpDocComment docComment = field.getDocComment();
View Full Code Here

Examples of com.jetbrains.php.lang.psi.resolve.types.PhpType

        String scopeVariable = forScopeVariable.getText();

        // find array types; since they are phptypes they ends with []
        Set<String> types = new HashSet<String>();

        PhpType phpType = new PhpType();
        phpType.add(globalVars.get(variableName).getTypes());

        for(String arrayType: PhpIndex.getInstance(psiElement.getProject()).completeType(psiElement.getProject(), phpType, new HashSet<String>()).getTypes()) {
            if(arrayType.endsWith("[]")) {
                types.add(arrayType.substring(0, arrayType.length() -2));
            }
View Full Code Here

Examples of com.jetbrains.php.lang.psi.resolve.types.PhpType

        for(TwigTypeContainer phpNamedElement: previousElement) {

            if(phpNamedElement.getPhpNamedElement() != null) {
                for(PhpNamedElement target : getTwigPhpNameTargets(phpNamedElement.getPhpNamedElement(), typeName)) {
                    PhpType phpType = target.getType();
                    for(String typeString: phpType.getTypes()) {
                        PhpNamedElement phpNamedElement1 = PhpElementsUtil.getClassInterface(phpNamedElement.getPhpNamedElement().getProject(), typeString);
                        if(phpNamedElement1 != null) {
                            phpNamedElements.add(new TwigTypeContainer(phpNamedElement1));
                        }
                    }
View Full Code Here

Examples of com.jetbrains.php.lang.psi.resolve.types.PhpType

            if(phpClass.getPresentableFQN() != null) {
                return phpClass.getPresentableFQN();
            }
        }

        PhpType phpType = new PhpType();
        phpType.add(types);
        PhpType phpTypeFormatted = PhpIndex.getInstance(project).completeType(project, phpType, new HashSet<String>());

        if(phpTypeFormatted.getTypes().size() > 0) {
            return StringUtils.join(phpTypeFormatted.getTypes(), "|");
        }

        if(types.size() > 0) {
            return types.iterator().next();
        }
View Full Code Here

Examples of com.jetbrains.php.lang.psi.resolve.types.PhpType

        return null;
    }

    public static Collection<PhpClass> getClassFromPhpTypeSet(Project project, Set<String> types) {

        PhpType phpType = new PhpType();
        phpType.add(types);

        ArrayList<PhpClass> phpClasses = new ArrayList<PhpClass>();

        for(String typeName: PhpIndex.getInstance(project).completeType(project, phpType, new HashSet<String>()).getTypes()) {
            if(typeName.startsWith("\\")) {
View Full Code Here

Examples of com.jetbrains.php.lang.psi.resolve.types.PhpType

        return phpClasses;
    }

    public static Collection<PhpClass> getClassFromPhpTypeSetArrayClean(Project project, Set<String> types) {

        PhpType phpType = new PhpType();
        phpType.add(types);

        ArrayList<PhpClass> phpClasses = new ArrayList<PhpClass>();

        for(String typeName: PhpIndex.getInstance(project).completeType(project, phpType, new HashSet<String>()).getTypes()) {
            if(typeName.startsWith("\\")) {
View Full Code Here

Examples of org.pdtextensions.core.PHPType

                    public boolean visit(FullyQualifiedReference s) throws Exception {
                      if (s.sourceStart() == match.getOffset() && s.sourceEnd() == match.getOffset() + match.getLength()) {
                        IModelElement sourceElement = PDTModelUtils.getSourceElement(module, s.sourceStart(), s.matchLength());
                        if (sourceElement != null) {
                          IType sourceType = (IType) sourceElement.getAncestor(IModelElement.TYPE);
                          if (sourceType != null && new PHPType(sourceType).isInstanceOf((IType) modelElement)) {
                            int offset;
                            if (s.getNamespace() == null) {
                              offset = s.sourceStart();
                            } else {
                              if ("\\".equals(s.getNamespace().getName())) { //$NON-NLS-1$
View Full Code Here

Examples of org.pdtextensions.core.PHPType

                  }
                } else {
                  IModelElement sourceElement = PDTModelUtils.getSourceElement(module, expression.getCallName().sourceStart(), expression.getCallName().matchLength());
                  if (sourceElement != null && sourceElement.getElementType() == IModelElement.METHOD) {
                    IType declaringType = ((IMethod) sourceElement).getDeclaringType();
                    if (declaringType != null && new PHPType(declaringType).isInstanceOf(method.getDeclaringType())) {
                      try {
                        addTextEdit(
                          changeManager.get(module),
                          getProcessorName(),
                          new ReplaceEdit(expression.getCallName().sourceStart(), method.getElementName().length(), getNewElementName())
View Full Code Here

Examples of org.pdtextensions.core.PHPType

              } else if (receiverReference instanceof TypeReference) {
                receiverTypes = PDTTypeInferenceUtils.getTypes((TypeReference) receiverReference, sourceModule);
              }
              if (receiverTypes != null && receiverTypes.length > 0) {
                IType ancestorType = (IType) modelElement.getAncestor(IModelElement.TYPE);
                if (ancestorType != null && new PHPType(receiverTypes[0]).isInstanceOf(ancestorType)) {
                  replaceEdit = createReplaceEdit(astNode);
                }
              }
            }
View Full Code Here

Examples of org.pdtextensions.core.PHPType

  public boolean canEnableUpdateReferences() {
    IType enclosingType = (IType) modelElement.getAncestor(IModelElement.TYPE);
    if (enclosingType == null) return false;

    try {
      return new PHPType(enclosingType).inResourceWithSameName();
    } catch (CoreException e) {
      PEXUIPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, PEXUIPlugin.PLUGIN_ID, e.getMessage(), e));

      return false;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.