Package com.jetbrains.php.lang.psi.elements.impl

Examples of com.jetbrains.php.lang.psi.elements.impl.ArrayCreationExpressionImpl


            if (groupStatement != null) {
                for (PsiElement pl : groupStatement.getChildren()) {
                    if (pl.toString().equals("Return")) {
                        PsiElement[] pl2 = pl.getChildren();
                        if (pl2.length > 0 && pl2[0].toString().equals("Array creation expression")) {
                            ArrayCreationExpressionImpl ar = (ArrayCreationExpressionImpl) pl2[0];
                            if (ar.getChildren().length > 0) {
                                for (ArrayHashElement he : ar.getHashElements()) {
                                    String val = he.getValue().getText();
                                    String key = he.getKey().getText();
                                    hashx.put(CommonHelper.rmQuotes(
                                            key.substring(0, key.length() > 40 ? 40 : key.length())
                                    ),
View Full Code Here


                pf.getManager().reloadFromDisk(pf);
                for (PsiElement pl : groupStatement.getChildren()) {
                    if (pl.toString().equals("Return")) {
                        PsiElement[] pl2 = pl.getChildren();
                        if (pl2.length > 0 && pl2[0].toString().equals("Array creation expression")) {
                            ArrayCreationExpressionImpl ar = (ArrayCreationExpressionImpl) pl2[0];

                            ArrayHashElement p = (ArrayHashElement) PhpPsiElementFactory.createFromText(project,
                                    PhpElementTypes.HASH_ARRAY_ELEMENT,
                                    "array('" + string + "'=>'')");
                            PsiElement closingBrace = ar.getLastChild();
                            String preLast = closingBrace.getPrevSibling().toString();
                            if (!preLast.equals("Comma")) {
                                pf.getViewProvider().getDocument().insertString(
                                        closingBrace.getTextOffset(), "," + lineSeparator + p.getText());
                            }
View Full Code Here

TOP

Related Classes of com.jetbrains.php.lang.psi.elements.impl.ArrayCreationExpressionImpl

Copyright © 2018 www.massapicom. 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.