Examples of PhpClass


Examples of com.jetbrains.php.lang.psi.elements.PhpClass

    @NotNull
    @Override
    public ResolveResult[] multiResolve(boolean incompleteCode) {

        PhpClass phpClass = ServiceUtil.getResolvedClassDefinition(getElement().getProject(), this.className);
        if(phpClass == null) {
            return new ResolveResult[0];
        }

        Method targetMethod = PhpElementsUtil.getClassMethod(phpClass, this.method);
View Full Code Here

Examples of com.jetbrains.php.lang.psi.elements.PhpClass

    @NotNull
    @Override
    public Object[] getVariants() {

        PhpClass phpClass = ServiceUtil.getResolvedClassDefinition(getElement().getProject(), this.className);
        if(phpClass == null) {
            return new Object[0];
        }

        List<LookupElement> lookupElements = new ArrayList<LookupElement>();
View Full Code Here

Examples of com.jetbrains.php.lang.psi.elements.PhpClass

                            PsiElement yamlCompoundValueService = yamlKeyValue.getParent();
                            if(yamlCompoundValueService instanceof YAMLCompoundValue) {
                                String className = YamlHelper.getYamlKeyValueAsString((YAMLCompoundValue) yamlCompoundValueService, "class", false);
                                if(className != null) {
                                    PhpClass serviceClass = ServiceUtil.getResolvedClassDefinition(psiElement.getProject(), className);
                                    if(serviceClass != null) {
                                        Method constructor = serviceClass.getConstructor();
                                        if(constructor != null) {
                                            attachInstanceAnnotation(psiElement, holder, test.size(), constructor);
                                        }
                                    }
                                }
View Full Code Here

Examples of com.jetbrains.php.lang.psi.elements.PhpClass

        YAMLKeyValue classKeyValue = YamlHelper.getYamlKeyValue(yamlKeyValue.getContext(), "class");
        if(classKeyValue == null) {
            return;
        }

        PhpClass serviceClass = ServiceUtil.getResolvedClassDefinition(psiElement.getProject(), classKeyValue.getValueText());
        if(serviceClass == null) {
            return;
        }

        Method constructor = serviceClass.getConstructor();
        if(constructor == null) {
            return;
        }

        attachInstanceAnnotation(psiElement, holder, yamlArray, constructor);
View Full Code Here

Examples of com.jetbrains.php.lang.psi.elements.PhpClass

        return StringUtils.join(lines, "\n");
    }

    private void serviceTagCallback(String className, TagCallbackInterface callback) {
        PhpClass phpClass = PhpElementsUtil.getClass(project, className);
        if(phpClass != null) {
            if( new Symfony2InterfacesUtil().isInstanceOf(phpClass, FormUtil.ABSTRACT_FORM_INTERFACE)) {
                Set<String> aliases = FormUtil.getFormAliases(phpClass);
                if(aliases.size() > 0) {
                    callback.onFormTypeAlias(aliases.iterator().next());
View Full Code Here

Examples of com.jetbrains.php.lang.psi.elements.PhpClass

        YAMLKeyValue classKeyValue = YamlHelper.getYamlKeyValue(serviceDefinition, "class");
        if(classKeyValue == null) {
            return;
        }

        PhpClass serviceClass = ServiceUtil.getResolvedClassDefinition(psiElement.getProject(), classKeyValue.getValueText());
        if(serviceClass == null) {
            return;
        }

        Method method = PhpElementsUtil.getClassMethod(serviceClass, methodName);
View Full Code Here

Examples of com.jetbrains.php.lang.psi.elements.PhpClass

        String serviceName = getServiceName(psiElement);
        if(StringUtils.isBlank(serviceName)) {
            return;
        }

        PhpClass serviceParameterClass = ServiceUtil.getResolvedClassDefinition(psiElement.getProject(), getServiceName(psiElement));
        if(serviceParameterClass == null) {
            return;
        }

        Parameter[] constructorParameter = constructor.getParameters();
        if(parameterIndex >= constructorParameter.length) {
            return;
        }

        PhpClass expectedClass = PhpElementsUtil.getClassInterface(psiElement.getProject(), constructorParameter[parameterIndex].getDeclaredType().toString());
        if(expectedClass == null) {
            return;
        }

        if(!new Symfony2InterfacesUtil().isInstanceOf(serviceParameterClass, expectedClass)) {
            holder.createWeakWarningAnnotation(psiElement, "Expect instance of: " + expectedClass.getPresentableFQN());
        }
    }
View Full Code Here

Examples of com.jetbrains.php.lang.psi.elements.PhpClass

        YAMLKeyValue classKeyValue = YamlHelper.getYamlKeyValue(callYamlKeyValue.getContext(), "class");
        if(classKeyValue == null) {
            return;
        }

        PhpClass serviceParameterClass = ServiceUtil.getResolvedClassDefinition(psiElement.getProject(), getServiceName(classKeyValue.getValue()));
        if(serviceParameterClass == null) {
            return;
        }

        if(PhpElementsUtil.getClassMethod(serviceParameterClass, PsiElementUtils.trimQuote(psiElement.getText())) == null) {
View Full Code Here

Examples of org.netbeans.modules.php.api.editor.PhpClass

    /**
     * Test of getViewName method, of class YiiUtils.
     */
    @Test
    public void testGetViewName() {
        PhpClass phpClass = new PhpClass("SiteController", "SiteController");
        phpClass.addMethod("actionIndex", "actionIndex");
        for (PhpClass.Method method : phpClass.getMethods()) {
            assertEquals("index", YiiUtils.getViewName(method));
        }
        phpClass = new PhpClass("SiteController", "SiteController");
        phpClass.addMethod("actions", "actions");
        for (PhpClass.Method method : phpClass.getMethods()) {
            assertEquals(null, YiiUtils.getViewName(method));
        }
    }
View Full Code Here

Examples of org.netbeans.modules.php.api.editor.PhpClass

            FileObject controller = YiiUtils.getController(fo);
            if (controller != null) {
                List<PhpBaseElement> elements = new LinkedList<PhpBaseElement>();
                String controllerName = controller.getName();
                // add controller and variables
                PhpClass controllerClass = new PhpClass(controllerName, controllerName);
                PhpVariable phpVariable = new PhpVariable("$this", controllerClass, controller, 0); // NOI18N
                elements.add(phpVariable);
                elements.addAll(parseAction(fo));

                return elements;
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.