Examples of PhpDocComment


Examples of com.jetbrains.php.lang.documentation.phpdoc.psi.PhpDocComment

        }

        // @Foo(targetEntity="Foo\Class")
        if(annotationPropertyParameter.getType() == AnnotationPropertyParameter.Type.PROPERTY_VALUE && "referencedColumnName".equals(annotationPropertyParameter.getPropertyName())) {

            PhpDocComment phpDocComment = PsiTreeUtil.getParentOfType(element, PhpDocComment.class);
            if(phpDocComment != null) {
                PhpDocCommentAnnotation phpDocCommentAnnotationContainer = AnnotationUtil.getPhpDocCommentAnnotationContainer(phpDocComment);

                if(phpDocCommentAnnotationContainer != null) {
View Full Code Here

Examples of com.jetbrains.php.lang.documentation.phpdoc.psi.PhpDocComment

        if(phpClass == null) {
            return null;
        }

        // search on annotations
        PhpDocComment docAnnotation = phpClass.getDocComment();
        if(docAnnotation != null) {

            // search for repositoryClass="Foo\Bar\RegisterRepository"
            // @MongoDB\Document; @ORM\Entity
            String docAnnotationText = docAnnotation.getText();
            Matcher matcher = Pattern.compile("repositoryClass[\\s]*=[\\s]*[\"|'](.*)[\"|']").matcher(docAnnotationText);
            if (matcher.find()) {
                return getAnnotationRepositoryClass(phpClass, matcher.group(1));
            }
        }
View Full Code Here

Examples of com.jetbrains.php.lang.documentation.phpdoc.psi.PhpDocComment

            }
        }

        // provide fallback on annotations
        // @TODO: better detect annotation switch; yaml and annotation are valid; need deps on annotation plugin
        PhpDocComment docComment = phpClass.getDocComment();
        if(docComment != null) {
            if(docComment.getText().contains("Entity") || docComment.getText().contains("@ORM") || docComment.getText().contains("repositoryClass")) {
                for(Field field: phpClass.getFields()) {
                    if(!field.isConstant() && fieldName.equals(field.getName())) {
                        psiElements.add(field);
                    }
                }
View Full Code Here

Examples of com.jetbrains.php.lang.documentation.phpdoc.psi.PhpDocComment

            return modelFields;
        }

        // provide fallback on annotations
        PhpDocComment docComment = phpClass.getDocComment();
        if(docComment != null) {
            if(AnnotationBackportUtil.hasReference(docComment, "\\Doctrine\\ORM\\Mapping\\Entity")) {
                for(Field field: phpClass.getFields()) {
                    if(!field.isConstant()) {
                        if(AnnotationBackportUtil.hasReference(field.getDocComment(), ANNOTATION_FIELDS)) {
View Full Code Here

Examples of com.jetbrains.php.lang.documentation.phpdoc.psi.PhpDocComment

        // @TODO: de.espend.idea.php.annotation.util.AnnotationUtil.getPhpDocCommentAnnotationContainer()
        // fully require plugin now?

        // get some more presentable completion information
        // dont resolve docblocks; just extract them from doc comment
        PhpDocComment docBlock = field.getDocComment();

        if(docBlock == null) {
            return;
        }

        String text = docBlock.getText();

        // column type
        Matcher matcher = Pattern.compile("type[\\s]*=[\\s]*[\"|']([\\w_\\\\]+)[\"|']").matcher(text);
        if (matcher.find()) {
            doctrineModelField.setTypeName(matcher.group(1));
View Full Code Here

Examples of com.jetbrains.php.lang.documentation.phpdoc.psi.PhpDocComment

        if (matcher.find()) {
            templateName = matcher.group(1);
        } else {

            // find template name on last method
            PhpDocComment docComment = PsiTreeUtil.getParentOfType(parameter.getPhpDocTag(), PhpDocComment.class);
            if(null == docComment) {
                return;
            }

            Method method = PsiTreeUtil.getNextSiblingOfType(docComment, Method.class);
View Full Code Here

Examples of com.jetbrains.php.lang.documentation.phpdoc.psi.PhpDocComment

    }

    public static Map<String, PsiElement> getTemplateAnnotationFilesWithSiblingMethod(PhpDocTag phpDocTag) {
        Map<String, PsiElement> targets = TwigUtil.getTemplateAnnotationFiles(phpDocTag);

        PhpDocComment phpDocComment = PsiTreeUtil.getParentOfType(phpDocTag, PhpDocComment.class);
        if(phpDocComment != null) {
            PsiElement method = phpDocComment.getNextPsiSibling();
            if(method instanceof Method) {
                String templateName = TwigUtil.getControllerMethodShortcut((Method) method);
                if(templateName != null) {
                    for(PsiElement psiElement: TwigHelper.getTemplatePsiElements(method.getProject(), templateName)) {
                        targets.put(templateName, psiElement);
View Full Code Here

Examples of com.jetbrains.php.lang.documentation.phpdoc.psi.PhpDocComment

    public void collectGotoRelatedItems(ControllerActionGotoRelatedCollectorParameter parameter) {

        Set<String> uniqueTemplates = new HashSet<String>();

        // on @Template annotation
        PhpDocComment phpDocComment = parameter.getMethod().getDocComment();
        if(phpDocComment != null) {
            Collection<PhpDocTag> phpDocTags = AnnotationBackportUtil.filterValidDocTags(PsiTreeUtil.findChildrenOfType(phpDocComment, PhpDocTag.class));
            if(phpDocTags.size() > 0) {
                // cache use map for this phpDocComment
                Map<String, String> importMap = AnnotationBackportUtil.getUseImportMap(phpDocComment);
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.