This is an automated email from the ASF dual-hosted git repository. junichi11 pushed a commit to branch php-nb21-features in repository https://gitbox.apache.org/repos/asf/netbeans.git
commit d564b40f39bb3c6248ec95f560319c074d81fd11 Author: Junichi Yamamoto <junich...@apache.org> AuthorDate: Thu Sep 28 09:08:23 2023 +0900 PHP 8.2 Support: Disjunctive Normal Form Types (Part 3) - https://github.com/apache/netbeans/issues/4725 - https://wiki.php.net/rfc/dnf_types - Fix DNF parameter types for the navigator - The following cases are incorrect syntax for `@method` tag ``` @method int i() i($a = array()) Comment 10 ``` - See: https://docs.phpdoc.org/3.0/guide/references/phpdoc/tags/method.html#method - So, disable `PHPCodeCompletion201870Test` and `PHPCodeCompletion203294Test` --- .../org/netbeans/modules/php/editor/CodeUtils.java | 4 + .../php/editor/api/elements/ParameterElement.java | 4 + .../php/editor/completion/PHPCompletionItem.java | 2 + .../modules/php/editor/csl/NavigatorScanner.java | 61 ++--- .../php/editor/elements/MethodElementImpl.java | 2 +- .../php/editor/elements/ParameterElementImpl.java | 39 ++- .../modules/php/editor/index/PHPIndexer.java | 2 +- .../modules/php/editor/model/Parameter.java | 6 + .../php/editor/model/impl/FunctionScopeImpl.java | 2 +- .../php/editor/model/impl/ParameterImpl.java | 33 ++- .../php/editor/model/impl/VariousUtils.java | 20 +- .../editor/model/nodes/FormalParameterInfo.java | 19 +- .../model/nodes/FunctionDeclarationInfo.java | 3 +- .../model/nodes/LambdaFunctionDeclarationInfo.java | 2 +- .../model/nodes/MagicMethodDeclarationInfo.java | 25 +- .../editor/model/nodes/MethodDeclarationInfo.java | 3 +- .../php/editor/parser/PHPDocCommentParser.java | 48 +++- .../deprecatedTypesForNullableTypes_01.pass | 2 +- .../deprecatedTypesForNullableTypes_02.pass | 2 +- .../php82/deprecatedDnfParameterTypes_01.pass | 15 ++ .../NavigatorTest/structure/nullableTypes_01.pass | 2 +- .../NavigatorTest/structure/nullableTypes_02.pass | 2 +- .../structure/php82/dnfParameterTypes.pass | 26 ++ .../index/testGetEnums/testGetEnums.php.indexed | 4 +- .../testGetFunctions/testGetFunctions.php.indexed | 2 +- .../testIssue240824/testIssue240824.php.indexed | 2 +- .../testNullableTypesForFunctions.php.indexed | 4 +- .../testNullableTypesForMethods.php.indexed | 8 +- ...stPHP80ConstructorPropertyPromotion.php.indexed | 20 +- .../testPHP80UnionTypesFunctions.php.indexed | 12 +- .../testPHP80UnionTypesTypes.php.indexed | 16 +- .../testPHP81PureIntersectionTypes.php.indexed | 16 +- .../testPHP82DNFParameterTypes.php | 69 +++++ .../testPHP82DNFParameterTypes.php.indexed | 281 +++++++++++++++++++++ .../testPHP82DNFReturnTypes.php.indexed | 2 +- .../php82/deprecatedDnfParameterTypes_01.php | 58 +++++ .../structure/php82/dnfParameterTypes.php | 69 +++++ .../completion/PHPCodeCompletion201870Test.java | 5 +- .../completion/PHPCodeCompletion203294Test.java | 5 +- .../php/editor/csl/NavigatorDeprecatedTest.java | 4 + .../modules/php/editor/csl/NavigatorTest.java | 4 + .../modules/php/editor/index/PHPIndexTest.java | 4 + 42 files changed, 796 insertions(+), 113 deletions(-) diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java b/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java index e18311e208..ab54785743 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/CodeUtils.java @@ -25,6 +25,7 @@ import java.util.LinkedList; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; +import java.util.regex.Pattern; import javax.swing.text.Document; import org.netbeans.api.annotations.common.CheckForNull; import org.netbeans.api.annotations.common.NonNull; @@ -87,6 +88,9 @@ public final class CodeUtils { public static final String STATIC_METHOD_TYPE_PREFIX = "@static.mtd:"; // NOI18N public static final String NULLABLE_TYPE_PREFIX = "?"; // NOI18N public static final String ELLIPSIS = "..."; // NOI18N + + public static final Pattern WHITE_SPACES_PATTERN = Pattern.compile("\\s+"); // NOI18N + private static final Logger LOGGER = Logger.getLogger(CodeUtils.class.getName()); private CodeUtils() { diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/api/elements/ParameterElement.java b/php/php.editor/src/org/netbeans/modules/php/editor/api/elements/ParameterElement.java index 389aeebc95..7993e50ac2 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/api/elements/ParameterElement.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/api/elements/ParameterElement.java @@ -37,6 +37,10 @@ public interface ParameterElement { int getModifier(); Set<TypeResolver> getTypes(); @CheckForNull + String getDeclaredType(); + @CheckForNull + String getPhpdocType(); + @CheckForNull String getDefaultValue(); /** * @return false if the type information is taken from PHPDoc diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/completion/PHPCompletionItem.java b/php/php.editor/src/org/netbeans/modules/php/editor/completion/PHPCompletionItem.java index 8c39255206..4315df71ff 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/completion/PHPCompletionItem.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/completion/PHPCompletionItem.java @@ -605,6 +605,8 @@ public abstract class PHPCompletionItem implements CompletionProposal { variableToUseName.getName(), param.getDefaultValue(), param.getOffset(), + param.getDeclaredType(), + param.getPhpdocType(), param.getTypes(), param.isMandatory(), param.hasDeclaredType(), diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/csl/NavigatorScanner.java b/php/php.editor/src/org/netbeans/modules/php/editor/csl/NavigatorScanner.java index d9fddf9367..3eed34cc26 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/csl/NavigatorScanner.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/csl/NavigatorScanner.java @@ -27,6 +27,7 @@ import java.util.List; import java.util.Set; import java.util.logging.Logger; import javax.swing.ImageIcon; +import org.netbeans.api.annotations.common.NullAllowed; import org.netbeans.api.annotations.common.StaticResource; import org.netbeans.modules.csl.api.ElementHandle; import org.netbeans.modules.csl.api.ElementKind; @@ -412,7 +413,7 @@ public final class NavigatorScanner { } formatter.appendText("("); //NOI18N List<? extends ParameterElement> parameters = function.getParameters(); - if (parameters != null && parameters.size() > 0) { + if (parameters != null && !parameters.isEmpty()) { processParameters(function, formatter, parameters); } formatter.appendText(")"); //NOI18N @@ -437,26 +438,12 @@ public final class NavigatorScanner { if (!first) { formatter.appendText(", "); //NOI18N } - if (!types.isEmpty()) { - formatter.appendHtml(FONT_GRAY_COLOR); - int i = 0; - for (TypeResolver typeResolver : types) { - i++; - if (typeResolver.isResolved()) { - QualifiedName typeName = typeResolver.getTypeName(false); - if (typeName != null) { - if (i > 1) { - formatter.appendText(Type.getTypeSeparator(formalParameter.isIntersectionType())); - } - if (typeResolver.isNullableType()) { - formatter.appendText(CodeUtils.NULLABLE_TYPE_PREFIX); - } - processTypeName(typeName.toString(), function, formatter); - } - } - } - formatter.appendText(" "); //NOI18N - formatter.appendHtml(CLOSE_FONT); + if (formalParameter.hasDeclaredType()) { + processDeclaredType(function, formatter, formalParameter.getDeclaredType(), false); + } else if (formalParameter.getPhpdocType() != null) { + processDeclaredType(function, formatter, formalParameter.getPhpdocType(), false); + } else { + assert types.isEmpty() : function.getName() + " has " + types.size() + " parameter(s)"; // NOI18N } formatter.appendText(name); first = false; @@ -486,11 +473,22 @@ public final class NavigatorScanner { formatter.appendHtml(CLOSE_FONT); } - private void processReturnTypes(FunctionScope function, HtmlFormatter formatter, String declaredReturnType) { - formatter.appendHtml(FONT_GRAY_COLOR + ":"); //NOI18N - StringBuilder sb = new StringBuilder(declaredReturnType.length()); - for (int i = 0; i < declaredReturnType.length(); i++) { - char c = declaredReturnType.charAt(i); + private void processReturnTypes(FunctionScope function, HtmlFormatter formatter, @NullAllowed String declaredReturnType) { + processDeclaredType(function, formatter, declaredReturnType, true); + } + + protected void processDeclaredType(ModelElement modelElement, HtmlFormatter formatter, @NullAllowed String declaredType, boolean isReturn) { + if (declaredType == null) { + return; + } + if (isReturn) { + formatter.appendHtml(FONT_GRAY_COLOR + ":"); // NOI18N + } else { + formatter.appendHtml(FONT_GRAY_COLOR); + } + StringBuilder sb = new StringBuilder(declaredType.length()); + for (int i = 0; i < declaredType.length(); i++) { + char c = declaredType.charAt(i); switch (c) { case '(': // no break case '?': @@ -499,7 +497,7 @@ public final class NavigatorScanner { case ')': // no break case '|': // no break case '&': - processTypeName(sb, function, formatter); + processTypeName(sb, modelElement, formatter); formatter.appendText(String.valueOf(c)); break; default: @@ -508,17 +506,20 @@ public final class NavigatorScanner { } } if (sb.length() > 0) { - processTypeName(sb, function, formatter); + processTypeName(sb, modelElement, formatter); + } + if (!isReturn) { + formatter.appendText(" "); // NOI18N } formatter.appendHtml(CLOSE_FONT); } } - private void processTypeName(StringBuilder sb, FunctionScope function, HtmlFormatter formatter) { + private void processTypeName(StringBuilder sb, ModelElement modelElement, HtmlFormatter formatter) { String type = sb.toString(); if (sb.length() > 0) { sb.delete(0, sb.length()); - processTypeName(type, function, formatter); + processTypeName(type, modelElement, formatter); } } diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/elements/MethodElementImpl.java b/php/php.editor/src/org/netbeans/modules/php/editor/elements/MethodElementImpl.java index 98823fc0c4..0e5fe77fd0 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/elements/MethodElementImpl.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/elements/MethodElementImpl.java @@ -120,7 +120,7 @@ public final class MethodElementImpl extends PhpElementImpl implements MethodEle private static List<ParameterElement> fromParameterNames(String... names) { List<ParameterElement> retval = new ArrayList<>(); for (String parameterName : names) { - retval.add(new ParameterElementImpl(parameterName, null, 0, Collections.<TypeResolver>emptySet(), true, true, false, false, false, 0, false)); + retval.add(new ParameterElementImpl(parameterName, null, 0, null, null, Collections.<TypeResolver>emptySet(), true, true, false, false, false, 0, false)); } return retval; } diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/elements/ParameterElementImpl.java b/php/php.editor/src/org/netbeans/modules/php/editor/elements/ParameterElementImpl.java index 1ef5fe2ee7..b8a69c0acf 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/elements/ParameterElementImpl.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/elements/ParameterElementImpl.java @@ -23,6 +23,7 @@ import java.util.EnumSet; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; +import org.netbeans.api.annotations.common.CheckForNull; import org.netbeans.modules.csl.api.OffsetRange; import org.netbeans.modules.php.api.util.StringUtils; import org.netbeans.modules.php.editor.CodeUtils; @@ -40,6 +41,8 @@ import org.openide.util.Exceptions; public final class ParameterElementImpl implements ParameterElement { private final String name; private final String defaultValue; + private final String declaredType; + private final String phpdocType; private final Set<TypeResolver> types; private final int offset; private final boolean isRawType; @@ -54,6 +57,8 @@ public final class ParameterElementImpl implements ParameterElement { final String name, final String defaultValue, final int offset, + final String declaredType, + final String phpdocType, final Set<TypeResolver> types, final boolean isMandatory, final boolean isRawType, @@ -67,6 +72,8 @@ public final class ParameterElementImpl implements ParameterElement { this.isMandatory = isMandatory; this.defaultValue = (!isMandatory && defaultValue != null) ? decode(defaultValue) : ""; //NOI18N this.offset = offset; + this.declaredType = declaredType; + this.phpdocType = (phpdocType != null && phpdocType.contains(";")) ? null : phpdocType; // NOI18N e.g. Ty;p;e (see: issue240824) this.types = types; this.isRawType = isRawType; this.isReference = isReference; @@ -112,8 +119,10 @@ public final class ParameterElementImpl implements ParameterElement { int modifier = Integer.parseInt(parts[8]); boolean isIntersectionType = Integer.parseInt(parts[9]) > 0; String defValue = parts.length > 3 ? parts[3] : null; + String declaredType = parts.length > 10 ? parts[10] : null; + String phpdocType = parts.length > 11 ? parts[11] : null; retval = new ParameterElementImpl( - paramName, defValue, -1, types, isMandatory, isRawType, isReference, isVariadic, isUnionType, modifier, isIntersectionType); + paramName, defValue, -1, declaredType, phpdocType, types, isMandatory, isRawType, isReference, isVariadic, isUnionType, modifier, isIntersectionType); } return retval; } @@ -124,6 +133,8 @@ public final class ParameterElementImpl implements ParameterElement { assert parameterName.equals(encode(parameterName)) : parameterName; sb.append(parameterName).append(Separator.COLON); StringBuilder typeBuilder = new StringBuilder(); + // XXX just keep all types + // note: dnf types are indexed as union types e.g. (X&Y)|Z -> X|Y|Z for (TypeResolver typeResolver : getTypes()) { TypeResolverImpl resolverImpl = (TypeResolverImpl) typeResolver; if (typeBuilder.length() > 0) { @@ -153,6 +164,10 @@ public final class ParameterElementImpl implements ParameterElement { sb.append(modifier); sb.append(Separator.COLON); sb.append(isIntersectionType ? 1 : 0); + sb.append(Separator.COLON); + sb.append((declaredType != null) ? declaredType : ""); // NOI18N + sb.append(Separator.COLON); + sb.append((phpdocType != null) ? phpdocType : ""); // NOI18N checkSignature(sb); return sb.toString(); } @@ -174,6 +189,18 @@ public final class ParameterElementImpl implements ParameterElement { return new LinkedHashSet<>(types); } + @CheckForNull + @Override + public String getDeclaredType() { + return declaredType; + } + + @CheckForNull + @Override + public String getPhpdocType() { + return phpdocType; + } + @Override public String getDefaultValue() { return defaultValue; @@ -282,6 +309,16 @@ public final class ParameterElementImpl implements ParameterElement { assert isUnionType() == parsedParameter.isUnionType() : signature; assert getModifier() == parsedParameter.getModifier() : signature; assert isIntersectionType() == parsedParameter.isIntersectionType() : signature; + String declType = getDeclaredType(); + if (declType != null) { + String paramDeclaredType = parsedParameter.getDeclaredType(); + assert paramDeclaredType != null && declType.equals(paramDeclaredType) : signature; + } + String docType = getPhpdocType(); + if (docType != null) { + String paramPhpDocType = parsedParameter.getPhpdocType(); + assert paramPhpDocType != null && docType.equals(paramPhpDocType) : signature; + } } catch (NumberFormatException originalException) { final String message = String.format("%s [for signature: %s]", originalException.getMessage(), signature); //NOI18N final NumberFormatException formatException = new NumberFormatException(message); diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/index/PHPIndexer.java b/php/php.editor/src/org/netbeans/modules/php/editor/index/PHPIndexer.java index 0a25de5f3d..f26fcf3d43 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/index/PHPIndexer.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/index/PHPIndexer.java @@ -220,7 +220,7 @@ public final class PHPIndexer extends EmbeddingIndexer { public static final class Factory extends EmbeddingIndexerFactory { public static final String NAME = "php"; // NOI18N - public static final int VERSION = 35; + public static final int VERSION = 36; @Override public EmbeddingIndexer createIndexer(final Indexable indexable, final Snapshot snapshot) { diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/Parameter.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/Parameter.java index 9a4380a63d..bc61bac535 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/model/Parameter.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/Parameter.java @@ -20,6 +20,7 @@ package org.netbeans.modules.php.editor.model; import java.util.List; +import org.netbeans.api.annotations.common.CheckForNull; import org.netbeans.modules.csl.api.OffsetRange; import org.netbeans.modules.php.editor.api.QualifiedName; @@ -31,6 +32,11 @@ public interface Parameter { String getName(); String getDefaultValue(); + @CheckForNull + String getDeclaredType(); + @CheckForNull + String getPhpdocType(); + @CheckForNull /** * @return false if the type information is taken from PHPDoc */ diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/FunctionScopeImpl.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/FunctionScopeImpl.java index e03300702e..70e1bfdb98 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/FunctionScopeImpl.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/FunctionScopeImpl.java @@ -491,7 +491,7 @@ class FunctionScopeImpl extends ScopeImpl implements FunctionScope, VariableName @NonNull @Override public List<? extends ParameterElement> getParameters() { - return paremeters; + return Collections.unmodifiableList(paremeters); } @Override diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/ParameterImpl.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/ParameterImpl.java index b4e64ef964..8b740e60b6 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/ParameterImpl.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/ParameterImpl.java @@ -22,6 +22,7 @@ package org.netbeans.modules.php.editor.model.impl; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import org.netbeans.api.annotations.common.CheckForNull; import org.netbeans.api.annotations.common.NonNull; import org.netbeans.modules.csl.api.OffsetRange; import org.netbeans.modules.php.editor.api.QualifiedName; @@ -35,6 +36,8 @@ import org.openide.util.Exceptions; public class ParameterImpl implements Parameter { private final String name; private final String defaultValue; + private final String declaredType; + private final String phpdocType; private final List<QualifiedName> types; private final OffsetRange range; private final boolean isRawType; @@ -54,10 +57,14 @@ public class ParameterImpl implements Parameter { boolean isVariadic, boolean isUnionType, int modifier, - boolean isIntersectionType + boolean isIntersectionType, + String declaredType, + String phpdocType ) { this.name = name; this.defaultValue = defaultValue; + this.declaredType = declaredType; + this.phpdocType = phpdocType; if (types == null) { this.types = Collections.emptyList(); } else { @@ -84,6 +91,18 @@ public class ParameterImpl implements Parameter { return defaultValue; } + @CheckForNull + @Override + public String getDeclaredType() { + return declaredType; + } + + @CheckForNull + @Override + public String getPhpdocType() { + return phpdocType; + } + @Override public boolean isMandatory() { return defaultValue == null; @@ -151,6 +170,10 @@ public class ParameterImpl implements Parameter { sb.append(modifier); sb.append(":"); //NOI18N sb.append(isIntersectionType ? 1 : 0); + sb.append(":"); //NOI18N + sb.append(declaredType); + sb.append(":"); //NOI18N + sb.append(phpdocType); return sb.toString(); } @@ -171,12 +194,14 @@ public class ParameterImpl implements Parameter { } } boolean isRawType = Integer.parseInt(parts[2]) > 0; - String defValue = (parts.length > 3) ? parts[3] : ""; + String defValue = (parts.length > 3) ? parts[3] : ""; // NOI18N boolean isReference = Integer.parseInt(parts[4]) > 0; boolean isVariadic = Integer.parseInt(parts[5]) > 0; boolean isUnionType = Integer.parseInt(parts[6]) > 0; int modifier = Integer.parseInt(parts[7]); boolean isIntersectionType = Integer.parseInt(parts[8]) > 0; + String declType = (parts.length > 9) ? parts[9] : null; + String docType = (parts.length > 10) ? parts[10] : null; parameters.add(new ParameterImpl( paramName, (defValue.length() != 0) ? decode(defValue) : null, @@ -187,7 +212,9 @@ public class ParameterImpl implements Parameter { isVariadic, isUnionType, modifier, - isIntersectionType + isIntersectionType, + declType, + docType )); } } diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/VariousUtils.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/VariousUtils.java index 9f7ba9a6bd..9c70064b09 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/VariousUtils.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/VariousUtils.java @@ -132,7 +132,6 @@ public final class VariousUtils { private static final String VAR_TYPE_COMMENT_PREFIX = "@var"; //NOI18N private static final String SPACES_AND_TYPE_DELIMITERS = "[| ]*"; //NOI18N private static final Pattern SEMI_TYPE_NAME_PATTERN = Pattern.compile("[" + PRE_OPERATION_TYPE_DELIMITER + POST_OPERATION_TYPE_DELIMITER + "]"); // NOI18N - private static final Pattern WS_PATTERN = Pattern.compile("\\s+"); // NOI18N private static final Pattern SEMICOLON_PATTERN = Pattern.compile("\\;"); // NOI18N private static final Pattern DOT_PATTERN = Pattern.compile("\\."); // NOI18N private static final Pattern TYPE_SEPARATOR_PATTERN = Pattern.compile("\\|"); // NOI18N @@ -341,8 +340,8 @@ public final class VariousUtils { return getDeprecatedDescriptionFromPHPDoc(root, node) != null; } - public static Map<String, List<Pair<QualifiedName, Boolean>>> getParamTypesFromPHPDoc(Program root, ASTNode node) { - Map<String, List<Pair<QualifiedName, Boolean>>> retval = new HashMap<>(); + public static Map<String, Pair<String, List<Pair<QualifiedName, Boolean>>>> getParamTypesFromPHPDoc(Program root, ASTNode node) { + Map<String, Pair<String, List<Pair<QualifiedName, Boolean>>>> retval = new HashMap<>(); Comment comment = Utils.getCommentForNode(root, node); if (comment instanceof PHPDocBlock) { @@ -350,7 +349,7 @@ public final class VariousUtils { for (PHPDocTag tag : phpDoc.getTags()) { if (tag.getKind().equals(PHPDocTag.Type.PARAM)) { - List<Pair<QualifiedName, Boolean>> types = new ArrayList<>(); + List<Pair<QualifiedName, Boolean>> allTypes = new ArrayList<>(); PHPDocVarTypeTag paramTag = (PHPDocVarTypeTag) tag; for (PHPDocTypeNode type : paramTag.getTypes()) { String typeName = type.getValue(); @@ -358,8 +357,15 @@ public final class VariousUtils { if (isNullableType) { typeName = typeName.substring(1); } - types.add(Pair.of(QualifiedName.create(typeName), isNullableType)); + allTypes.add(Pair.of(QualifiedName.create(typeName), isNullableType)); } + String value = paramTag.getValue().trim(); // e.g. (X&Y)|Z $variable + String[] split = CodeUtils.WHITE_SPACES_PATTERN.split(value); + String rawType = ""; // NOI18N + if (split.length > 0) { + rawType = split[0]; + } + Pair<String, List<Pair<QualifiedName, Boolean>>> types = Pair.of(rawType, allTypes); retval.put(paramTag.getVariable().getValue(), types); } } @@ -375,7 +381,7 @@ public final class VariousUtils { for (PHPDocTag tag : phpDoc.getTags()) { if (tag.getKind().equals(tagType)) { - String[] parts = WS_PATTERN.split(tag.getValue().trim(), 2); + String[] parts = CodeUtils.WHITE_SPACES_PATTERN.split(tag.getValue().trim(), 2); if (parts.length > 0) { String type = SEMICOLON_PATTERN.split(parts[0], 2)[0]; @@ -391,7 +397,7 @@ public final class VariousUtils { // private $field; PHPVarComment varComment = (PHPVarComment) comment; PHPDocVarTypeTag tag = varComment.getVariable(); - String[] parts = WS_PATTERN.split(tag.getValue().trim(), 3); // 3: @var Type $field + String[] parts = CodeUtils.WHITE_SPACES_PATTERN.split(tag.getValue().trim(), 3); // 3: @var Type $field if (parts.length > 1) { return parts[1]; } diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/FormalParameterInfo.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/FormalParameterInfo.java index 820d91a7b2..b9e2e87b2a 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/FormalParameterInfo.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/FormalParameterInfo.java @@ -44,7 +44,7 @@ import org.openide.util.Pair; public final class FormalParameterInfo extends ASTNodeInfo<FormalParameter> { private final ParameterElement parameter; - private FormalParameterInfo(FormalParameter node, Map<String, List<Pair<QualifiedName, Boolean>>> paramDocTypes) { + private FormalParameterInfo(FormalParameter node, Map<String, Pair<String, List<Pair<QualifiedName, Boolean>>>> paramDocTypes) { super(node); FormalParameter formalParameter = getOriginalNode(); String name = getName(); @@ -56,18 +56,22 @@ public final class FormalParameterInfo extends ASTNodeInfo<FormalParameter> { final boolean isIntersectionType = parameterType instanceof IntersectionType; QualifiedName parameterTypeName = QualifiedName.create(parameterType); List<Pair<QualifiedName, Boolean>> types; + final String declaredType = isRawType ? CodeUtils.extractQualifiedName(parameterType) : null; + final String phpDocType = (!paramDocTypes.isEmpty() && paramDocTypes.get(name) != null) + ? paramDocTypes.get(name).first() + : null; if (isRawType && parameterTypeName != null) { if (!Type.isPrimitive(parameterTypeName.toString()) || paramDocTypes.isEmpty()) { types = Collections.singletonList(Pair.of(parameterTypeName, isNullableType)); } else { - types = paramDocTypes.get(name); + types = getParamDocTypes(paramDocTypes, name); } } else if (isUnionType) { types = VariousUtils.getParamTypesFromUnionTypes((UnionType) parameterType); } else if (isIntersectionType) { types = VariousUtils.getParamTypesFromIntersectionTypes((IntersectionType) parameterType); } else { - types = paramDocTypes.get(name); + types = getParamDocTypes(paramDocTypes, name); } if (types == null) { types = Collections.emptyList(); @@ -76,6 +80,8 @@ public final class FormalParameterInfo extends ASTNodeInfo<FormalParameter> { name, defVal, getRange().getStart(), + declaredType, + phpDocType, TypeResolverImpl.forNames(types), formalParameter.isMandatory(), isRawType, @@ -87,10 +93,13 @@ public final class FormalParameterInfo extends ASTNodeInfo<FormalParameter> { ); } - public static FormalParameterInfo create(FormalParameter node, Map<String, List<Pair<QualifiedName, Boolean>>> paramDocTypes) { - return new FormalParameterInfo(node, paramDocTypes); + private List<Pair<QualifiedName, Boolean>> getParamDocTypes(Map<String, Pair<String, List<Pair<QualifiedName, Boolean>>>> paramDocTypes, String name) { + return paramDocTypes.get(name) != null ? paramDocTypes.get(name).second() : Collections.emptyList(); } + public static FormalParameterInfo create(FormalParameter node, Map<String, Pair<String, List<Pair<QualifiedName, Boolean>>>> paramDocTypes) { + return new FormalParameterInfo(node, paramDocTypes); + } @Override public Kind getKind() { diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/FunctionDeclarationInfo.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/FunctionDeclarationInfo.java index e47707dc18..5dcdaa5e10 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/FunctionDeclarationInfo.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/FunctionDeclarationInfo.java @@ -41,8 +41,7 @@ import org.openide.util.Pair; */ public class FunctionDeclarationInfo extends ASTNodeInfo<FunctionDeclaration> { - private final Map<String, List<Pair<QualifiedName, Boolean>>> paramDocTypes; - + private final Map<String, Pair<String /*declared type*/, List<Pair<QualifiedName, Boolean>>>> paramDocTypes; protected FunctionDeclarationInfo(Program program, FunctionDeclaration node) { super(node); diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/LambdaFunctionDeclarationInfo.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/LambdaFunctionDeclarationInfo.java index 5c8922d85f..ea152ae1f8 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/LambdaFunctionDeclarationInfo.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/LambdaFunctionDeclarationInfo.java @@ -39,7 +39,7 @@ import org.openide.util.Pair; */ public class LambdaFunctionDeclarationInfo extends ASTNodeInfo<LambdaFunctionDeclaration> { - private final Map<String, List<Pair<QualifiedName, Boolean>>> paramDocTypes = Collections.emptyMap(); + private final Map<String, Pair<String /*declared type*/, List<Pair<QualifiedName, Boolean>>>> paramDocTypes = Collections.emptyMap(); protected LambdaFunctionDeclarationInfo(LambdaFunctionDeclaration node) { diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/MagicMethodDeclarationInfo.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/MagicMethodDeclarationInfo.java index 599069764c..9c838e0d46 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/MagicMethodDeclarationInfo.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/MagicMethodDeclarationInfo.java @@ -25,6 +25,7 @@ import java.util.Collection; import java.util.LinkedList; import java.util.List; import java.util.Set; +import java.util.regex.Pattern; import org.netbeans.api.annotations.common.CheckForNull; import org.netbeans.modules.csl.api.OffsetRange; import org.netbeans.modules.php.editor.CodeUtils; @@ -53,13 +54,14 @@ public class MagicMethodDeclarationInfo extends ASTNodeInfo<PHPDocMethodTag> { private int offset; private int typeOffset; private final boolean isStatic; + private static final Pattern SPLIT_METHOD_NAMES_PATTERN = Pattern.compile("[(, ]"); // NOI18N MagicMethodDeclarationInfo(PHPDocMethodTag node) { super(node); // @method int get(Type $object) message // @method static int staticGet(Type $object) message - String[] parts = node.getValue().trim().split("\\s+", 3); //NOI18N - isStatic = parts.length >= 1 && parts[0].equals("static"); // NOI18N NETBEANS-1861 + String[] parts = CodeUtils.WHITE_SPACES_PATTERN.split(node.getValue().trim(), 3); + isStatic = parts.length >= 1 && parts[0].equals(Type.STATIC); // NETBEANS-1861 // the method is already checked whether it is static when PHPDocMethodTag is created // So, they should be the same result // see: PHPDocCommentParser.createTag() @@ -67,16 +69,17 @@ public class MagicMethodDeclarationInfo extends ASTNodeInfo<PHPDocMethodTag> { if (isStatic) { parts = Arrays.copyOfRange(parts, 1, parts.length); } - if (parts.length == 1 || (parts.length > 0 && parts[0].trim().indexOf("(") > 0)) { //NOI18N + String mtdName = node.getMethodName().getValue(); + if (parts.length == 1 || (parts.length > 0 && parts[0].trim().startsWith(mtdName))) { // don't check '(' because DNF return type has '(' e.g. (X&Y)|Z method() // expect that the type is void returnType = Type.VOID; - String[] methodNames = parts[0].split("[(, ]", 2); //NOI18N + String[] methodNames = SPLIT_METHOD_NAMES_PATTERN.split(parts[0], 2); if (methodNames.length > 0) { methodName = methodNames[0]; offset = getOriginalNode().getStartOffset() + PHPDocTag.Type.METHOD.toString().length() + 1 + node.getValue().indexOf(methodName); } } else if (parts.length >= 2) { - String[] methodNames = parts[1].split("[(, ]", 2); //NOI18N + String[] methodNames = SPLIT_METHOD_NAMES_PATTERN.split(parts[1], 2); if (parts[0].length() > 0 && methodNames.length > 0) { returnType = parts[0]; methodName = methodNames[0]; @@ -87,6 +90,15 @@ public class MagicMethodDeclarationInfo extends ASTNodeInfo<PHPDocMethodTag> { for (PHPDocVarTypeTag parameter : node.getParameters()) { Collection<Pair<QualifiedName, Boolean>> names = new LinkedList<>(); + String declaredType = null; + if (!parameter.getTypes().isEmpty()) { + // e.g. (X&Y)|Z $param = null + String[] paramValues = CodeUtils.WHITE_SPACES_PATTERN.split(parameter.getValue().trim(), 2); + if (!paramValues[0].trim().startsWith("$")) { // NOI18N + declaredType = paramValues[0].trim(); + assert !declaredType.isEmpty() : parameter.getValue(); + } + } for (PHPDocTypeNode type : parameter.getTypes()) { String typeName = type.getValue(); boolean isNullableType = CodeUtils.isNullableType(typeName); @@ -106,7 +118,8 @@ public class MagicMethodDeclarationInfo extends ASTNodeInfo<PHPDocMethodTag> { boolean isMandatory = defaultValue == null; boolean isReference = name.startsWith("&"); // NOI18N boolean isVariadic = name.startsWith("..."); // NOI18N - parameters.add(new ParameterElementImpl(name, defaultValue, 0, types, isMandatory, true, isReference, isVariadic, false, 0, false)); + boolean isRawType = declaredType != null; + parameters.add(new ParameterElementImpl(name, defaultValue, 0, declaredType, declaredType, types, isMandatory, isRawType, isReference, isVariadic, false, 0, false)); } } diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/MethodDeclarationInfo.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/MethodDeclarationInfo.java index e9c987d1ca..883959c232 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/MethodDeclarationInfo.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/MethodDeclarationInfo.java @@ -41,7 +41,8 @@ import org.openide.util.Pair; * @author Radek Matous */ public class MethodDeclarationInfo extends ASTNodeInfo<MethodDeclaration> { - Map<String, List<Pair<QualifiedName, Boolean>>> paramDocTypes = Collections.emptyMap(); + + private Map<String, Pair<String /*raw types*/, List<Pair<QualifiedName, Boolean>>>> paramDocTypes = Collections.emptyMap(); private final boolean isFromInterface; MethodDeclarationInfo(Program program, MethodDeclaration methodDeclaration, final boolean isFromInterface) { diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/parser/PHPDocCommentParser.java b/php/php.editor/src/org/netbeans/modules/php/editor/parser/PHPDocCommentParser.java index 6ba3e14cbf..1eb715c949 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/parser/PHPDocCommentParser.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/parser/PHPDocCommentParser.java @@ -260,13 +260,18 @@ public class PHPDocCommentParser { } List<PHPDocTypeNode> result = new ArrayList<>(); + int startPosition = startDescription; for (String stype : getTypes(description, tagType)) { stype = removeHTMLTags(stype); stype = sanitizeShapes(stype); - int startDocNode = findStartOfDocNode(originalComment, originalCommentStart, stype, startDescription); + stype = sanitizeBraces(stype); + int startDocNode = findStartOfDocNode(originalComment, originalCommentStart, stype, startPosition); if (startDocNode == -1) { continue; } + // move start position to find the position of the same class name + // e.g. (X&Y)|(X&Z) + startPosition = startDocNode + stype.length(); int index = stype.indexOf("::"); //NOI18N boolean isArray = (stype.indexOf('[') > 0 && stype.indexOf(']') > 0); if (isArray) { @@ -294,7 +299,10 @@ public class PHPDocCommentParser { } ArrayList<String> types = new ArrayList<>(); if (tokens.length > 0 && (isReturnTag(tagType) || !tokens[0].startsWith("$"))) { //NOI18N - if (tokens[0].indexOf('|') > -1 || tokens[0].indexOf('&') > -1) { + if (findParameterStartPosition(tokens[0]) != -1) { + // e.g. @method voidReturn((X&Y)|Z $param) + types.add(Type.VOID); + } else if (tokens[0].indexOf('|') > -1 || tokens[0].indexOf('&') > -1) { String[] ttokens = tokens[0].split("[|&]"); //NOI18N for (String ttoken : ttokens) { types.add(ttoken.trim()); @@ -326,11 +334,11 @@ public class PHPDocCommentParser { private String getMethodName(String description) { String name = null; - int index = description.indexOf('('); + int index = findParameterStartPosition(description); if (index > 0) { name = description.substring(0, index); index = name.lastIndexOf(' '); - if (index > 0) { + if (index >= 0) { // e.g. " methodName" has whitespace at 0 name = name.substring(index + 1); } } else { @@ -404,6 +412,16 @@ public class PHPDocCommentParser { return sanitizedType; } + private String sanitizeBraces(String type) { + String sanitizedType = type; + if (sanitizedType.startsWith("(")) { // NOI18N + sanitizedType = sanitizedType.substring(1).trim(); + } else if (sanitizedType.endsWith(")")) { // NOI18N + sanitizedType = sanitizedType.substring(0, sanitizedType.length() - 1); + } + return sanitizedType; + } + /** * Find the start position of the specified string in the comment. * @@ -480,6 +498,26 @@ public class PHPDocCommentParser { return PHPDocTypeTag.Type.METHOD == type; } + private static int findParameterStartPosition(String description) { + // e.g. static (X&Y)|Z method((X&Y)|Z $param) someting... + // return type may have a dnf type i.e. it has "(" + // so, also check the char just before "(" + char previousChar = ' '; + for (int i = 0; i < description.length(); i++) { + switch (description.charAt(i)) { + case '(': + if (previousChar != '|' && previousChar != '&' && previousChar != ' ') { + return i; + } + break; + default: + break; + } + previousChar = description.charAt(i); + } + return -1; + } + private static final class ParametersExtractorImpl implements ParametersExtractor { private int position = 0; @@ -499,7 +537,7 @@ public class PHPDocCommentParser { @Override public String extract(String description) { - int index = description.indexOf('('); + int index = findParameterStartPosition(description); int possibleParamIndex = description.indexOf('$'); if (index > -1 && possibleParamIndex > -1) { position += index; diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorDeprecatedTest/structure/deprecatedTypesForNullableTypes_01.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorDeprecatedTest/structure/deprecatedTypesForNullableTypes_01.pass index e0f537dbab..fbfbaf1e97 100644 --- a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorDeprecatedTest/structure/deprecatedTypesForNullableTypes_01.pass +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorDeprecatedTest/structure/deprecatedTypesForNullableTypes_01.pass @@ -1,4 +1,4 @@ |-DeprecatedForNullableTypes1 [196, 535] : DEPRECATED{ESCAPED{DeprecatedForNullableTypes1}} |--testMethod2 [51, 62] : DEPRECATED{ESCAPED{testMethod2}}ESCAPED{(}<font color="#999999">ESCAPED{?}DEPRECATED{ESCAPED{DeprecatedForNullableTypes1}}ESCAPED{ }</font>ESCAPED{$tags}ESCAPED{)}<font color="#999999">:ESCAPED{?}DEPRECATED{ESCAPED{\DeprecatedForNullableTypes1}}</font> |--$test [154, 158] : DEPRECATED{ESCAPED{$test}}<font color="#999999">:ESCAPED{?}DEPRECATED{ESCAPED{DeprecatedForNullableTypes1}}</font> -|--testMethod [356, 532] : ESCAPED{testMethod}ESCAPED{(}<font color="#999999">ESCAPED{?}DEPRECATED{ESCAPED{DeprecatedForNullableTypes1}}ESCAPED{ }</font>ESCAPED{$tags}ESCAPED{, }ESCAPED{$isNull}ESCAPED{)}<font color="#999999">:ESCAPED{?}DEPRECATED{ESCAPED{\DeprecatedForNullableTypes1}}</font> +|--testMethod [356, 532] : ESCAPED{testMethod}ESCAPED{(}<font color="#999999">ESCAPED{?}DEPRECATED{ESCAPED{DeprecatedForNullableTypes1}}ESCAPED{ }</font>ESCAPED{$tags}ESCAPED{, }<font color="#999999">ESCAPED{bool}ESCAPED{ }</font>ESCAPED{$isNull}ESCAPED{)}<font color="#999999">:ESCAPED{?}DEPRECATED{ESCAPED{\DeprecatedForNullableTypes1}}</font> diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorDeprecatedTest/structure/deprecatedTypesForNullableTypes_02.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorDeprecatedTest/structure/deprecatedTypesForNullableTypes_02.pass index ae28f947bc..ed0513e75b 100644 --- a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorDeprecatedTest/structure/deprecatedTypesForNullableTypes_02.pass +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorDeprecatedTest/structure/deprecatedTypesForNullableTypes_02.pass @@ -1,4 +1,4 @@ |-DeprecatedForNullableTypes2 [196, 565] : DEPRECATED{ESCAPED{DeprecatedForNullableTypes2}} |--testMethod2 [51, 62] : DEPRECATED{ESCAPED{testMethod2}}ESCAPED{(}<font color="#999999">ESCAPED{?}DEPRECATED{ESCAPED{DeprecatedForNullableTypes2}}ESCAPED{ }</font>ESCAPED{$tags}ESCAPED{)}<font color="#999999">:ESCAPED{?}DEPRECATED{ESCAPED{\DeprecatedForNullableTypes2}}</font> |--$test [154, 158] : DEPRECATED{ESCAPED{$test}}<font color="#999999">:ESCAPED{?}DEPRECATED{ESCAPED{DeprecatedForNullableTypes2}}</font> -|--testMethod [356, 562] : ESCAPED{testMethod}ESCAPED{(}<font color="#999999">ESCAPED{?}DEPRECATED{ESCAPED{DeprecatedForNullableTypes2}}ESCAPED{ }</font>ESCAPED{$tags}ESCAPED{, }ESCAPED{$isNull}ESCAPED{)}<font color="#999999">:ESCAPED{?}DEPRECATED{ESCAPED{DeprecatedForNullableTypes2}}</font> +|--testMethod [356, 562] : ESCAPED{testMethod}ESCAPED{(}<font color="#999999">ESCAPED{?}DEPRECATED{ESCAPED{DeprecatedForNullableTypes2}}ESCAPED{ }</font>ESCAPED{$tags}ESCAPED{, }<font color="#999999">ESCAPED{bool}ESCAPED{ }</font>ESCAPED{$isNull}ESCAPED{)}<font color="#999999">:ESCAPED{?}DEPRECATED{ESCAPED{DeprecatedForNullableTypes2}}</font> diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorDeprecatedTest/structure/php82/deprecatedDnfParameterTypes_01.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorDeprecatedTest/structure/php82/deprecatedDnfParameterTypes_01.pass new file mode 100644 index 0000000000..e6069fd817 --- /dev/null +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorDeprecatedTest/structure/php82/deprecatedDnfParameterTypes_01.pass @@ -0,0 +1,15 @@ +|-X [820, 824] : ESCAPED{X} +|-Y [831, 835] : ESCAPED{Y} +|-Z [842, 846] : ESCAPED{Z} +|-DeprecatedType [876, 893] : DEPRECATED{ESCAPED{DeprecatedType}} +|-parameterType [904, 1023] : ESCAPED{parameterType}ESCAPED{(}<font color="#999999">ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{&}DEPRECATED{ESCAPED{DeprecatedType}}ESCAPED{)}ESCAPED{|}ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Z}ESCAPED{)}ESCAPED{|}DEPRECATED{ESCAPED{DeprecatedType}}ESCAPED{ }</font>ESCAPED{$param1}ESCAPED{, }<font color="#999999">ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{&}DEPRECATED{ESCAPED{DeprecatedType}}ESCAPED{)}ESCAPED{|}DEPRECATED{ESCAPED{DeprecatedType}}ES [...] +|-TestClass [1031, 1235] : ESCAPED{TestClass} +|--__construct [1063, 1126] : ESCAPED{__construct}ESCAPED{(}<font color="#999999">ESCAPED{(}DEPRECATED{ESCAPED{DeprecatedType}}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}ESCAPED{Z}ESCAPED{|}ESCAPED{X}ESCAPED{ }</font>ESCAPED{$test}ESCAPED{)} +|--parameterType [1148, 1233] : ESCAPED{parameterType}ESCAPED{(}<font color="#999999">ESCAPED{(}DEPRECATED{ESCAPED{DeprecatedType}}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}ESCAPED{Z}ESCAPED{|}ESCAPED{X}ESCAPED{ }</font>ESCAPED{$param}ESCAPED{)}<font color="#999999">:ESCAPED{int}</font> +|-TestTrait [1243, 1370] : ESCAPED{TestTrait} +|--parameterType [1275, 1368] : ESCAPED{parameterType}ESCAPED{(}<font color="#999999">ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}ESCAPED{(}ESCAPED{Y}ESCAPED{&}ESCAPED{Z}ESCAPED{&}DEPRECATED{ESCAPED{DeprecatedType}}ESCAPED{)}ESCAPED{ }</font>ESCAPED{$param}ESCAPED{)}<font color="#999999">:ESCAPED{?}ESCAPED{string}</font> +|-TestInterface [1382, 1473] : ESCAPED{TestInterface} +|--parameterType [1418, 1471] : ESCAPED{parameterType}ESCAPED{(}<font color="#999999">ESCAPED{X}ESCAPED{|}ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{&}ESCAPED{Z}ESCAPED{)}ESCAPED{|}DEPRECATED{ESCAPED{DeprecatedType}}ESCAPED{ }</font>ESCAPED{$param}ESCAPED{)}<font color="#999999">:ESCAPED{void}</font> +|-TestEnum [1480, 1594] : ESCAPED{TestEnum} +|--Case1 [1500, 1505] : ESCAPED{Case1} +|--parameterType [1527, 1592] : ESCAPED{parameterType}ESCAPED{(}<font color="#999999">ESCAPED{int}ESCAPED{ }</font>ESCAPED{$param1}ESCAPED{, }<font color="#999999">ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}DEPRECATED{ESCAPED{DeprecatedType}}ESCAPED{ }</font>ESCAPED{$param2}ESCAPED{)}<font color="#999999">:ESCAPED{void}</font> diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/nullableTypes_01.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/nullableTypes_01.pass index de915fe0c8..6dc3efdb67 100644 --- a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/nullableTypes_01.pass +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/nullableTypes_01.pass @@ -1,4 +1,4 @@ |-PHPDocTags [130, 384] : ESCAPED{PHPDocTags} |--testMethod2 [34, 45] : ESCAPED{testMethod2}ESCAPED{(}<font color="#999999">ESCAPED{?}ESCAPED{PHPDocTags}ESCAPED{ }</font>ESCAPED{$tags}ESCAPED{)}<font color="#999999">:ESCAPED{?}ESCAPED{\PHPDocTags}</font> |--$test [103, 107] : ESCAPED{$test}<font color="#999999">:ESCAPED{?}ESCAPED{PHPDocTags}</font> -|--testMethod [239, 381] : ESCAPED{testMethod}ESCAPED{(}<font color="#999999">ESCAPED{?}ESCAPED{PHPDocTags}ESCAPED{ }</font>ESCAPED{$tags}ESCAPED{, }ESCAPED{$isNull}ESCAPED{)}<font color="#999999">:ESCAPED{?}ESCAPED{\PHPDocTags}</font> +|--testMethod [239, 381] : ESCAPED{testMethod}ESCAPED{(}<font color="#999999">ESCAPED{?}ESCAPED{PHPDocTags}ESCAPED{ }</font>ESCAPED{$tags}ESCAPED{, }<font color="#999999">ESCAPED{bool}ESCAPED{ }</font>ESCAPED{$isNull}ESCAPED{)}<font color="#999999">:ESCAPED{?}ESCAPED{\PHPDocTags}</font> diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/nullableTypes_02.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/nullableTypes_02.pass index 93533b9e5a..d6f4dafe05 100644 --- a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/nullableTypes_02.pass +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/nullableTypes_02.pass @@ -1,4 +1,4 @@ |-PHPDocTags [130, 397] : ESCAPED{PHPDocTags} |--testMethod2 [34, 45] : ESCAPED{testMethod2}ESCAPED{(}<font color="#999999">ESCAPED{?}ESCAPED{PHPDocTags}ESCAPED{ }</font>ESCAPED{$tags}ESCAPED{)}<font color="#999999">:ESCAPED{?}ESCAPED{\PHPDocTags}</font> |--$test [103, 107] : ESCAPED{$test}<font color="#999999">:ESCAPED{?}ESCAPED{PHPDocTags}</font> -|--testMethod [239, 394] : ESCAPED{testMethod}ESCAPED{(}<font color="#999999">ESCAPED{?}ESCAPED{PHPDocTags}ESCAPED{ }</font>ESCAPED{$tags}ESCAPED{, }ESCAPED{$isNull}ESCAPED{)}<font color="#999999">:ESCAPED{?}ESCAPED{PHPDocTags}</font> +|--testMethod [239, 394] : ESCAPED{testMethod}ESCAPED{(}<font color="#999999">ESCAPED{?}ESCAPED{PHPDocTags}ESCAPED{ }</font>ESCAPED{$tags}ESCAPED{, }<font color="#999999">ESCAPED{bool}ESCAPED{ }</font>ESCAPED{$isNull}ESCAPED{)}<font color="#999999">:ESCAPED{?}ESCAPED{PHPDocTags}</font> diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/php82/dnfParameterTypes.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/php82/dnfParameterTypes.pass new file mode 100644 index 0000000000..7859d62253 --- /dev/null +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/php82/dnfParameterTypes.pass @@ -0,0 +1,26 @@ +|-X [820, 824] : ESCAPED{X} +|-Y [831, 835] : ESCAPED{Y} +|-Z [842, 846] : ESCAPED{Z} +|-Test [853, 860] : ESCAPED{Test} +|-parameterType [871, 919] : ESCAPED{parameterType}ESCAPED{(}<font color="#999999">ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{&}ESCAPED{Test}ESCAPED{)}ESCAPED{|}ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Z}ESCAPED{)}ESCAPED{ }</font>ESCAPED{$param}ESCAPED{)}<font color="#999999">:ESCAPED{void}</font> +|-TestClass [927, 1060] : ESCAPED{TestClass} +|--parameterType [959, 1058] : ESCAPED{parameterType}ESCAPED{(}<font color="#999999">ESCAPED{(}ESCAPED{Test}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}ESCAPED{Z}ESCAPED{|}ESCAPED{X}ESCAPED{ }</font>ESCAPED{$param1}ESCAPED{, }<font color="#999999">ESCAPED{bool}ESCAPED{ }</font>ESCAPED{$param2}ESCAPED{)}<font color="#999999">:ESCAPED{(}ESCAPED{Test}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}ESCAPED{Z}ESCAPED{|}ESCAPED{X}</font> +|-TestTrait [1068, 1182] : ESCAPED{TestTrait} +|--parameterType [1100, 1180] : ESCAPED{parameterType}ESCAPED{(}<font color="#999999">ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}ESCAPED{(}ESCAPED{Y}ESCAPED{&}ESCAPED{Z}ESCAPED{&}ESCAPED{Test}ESCAPED{)}ESCAPED{ }</font>ESCAPED{$param}ESCAPED{)}<font color="#999999">:ESCAPED{self}</font> +|-TestInterface [1194, 1266] : ESCAPED{TestInterface} +|--parameterType [1230, 1264] : ESCAPED{parameterType}ESCAPED{(}<font color="#999999">ESCAPED{X}ESCAPED{|}ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{&}ESCAPED{Z}ESCAPED{)}ESCAPED{|}ESCAPED{Z}ESCAPED{ }</font>ESCAPED{$param}ESCAPED{)} +|-TestEnum [1273, 1377] : ESCAPED{TestEnum} +|--Case1 [1293, 1298] : ESCAPED{Case1} +|--parameterType [1320, 1375] : ESCAPED{parameterType}ESCAPED{(}<font color="#999999">ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{ }</font>ESCAPED{$param1}ESCAPED{, }<font color="#999999">ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}ESCAPED{Z}ESCAPED{ }</font>ESCAPED{$param2}ESCAPED{)}<font color="#999999">:ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}ESCAPED{Z}</font> +|-MagickMethods [2411, 2428] : ESCAPED{MagickMethods} +|--testVoid [1544, 1552] : ESCAPED{testVoid}ESCAPED{(}<font color="#999999">ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{&}ESCAPED{Z}ESCAPED{)}ESCAPED{|}ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Z}ESCAPED{)}ESCAPED{ }</font>ESCAPED{$test}ESCAPED{)}<font color="#999999">:ESCAPED{void}</font> +|--testType [1603, 1611] : ESCAPED{testType}ESCAPED{(}<font color="#999999">ESCAPED{X}ESCAPED{|}ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{&}ESCAPED{Z}ESCAPED{)}ESCAPED{|}ESCAPED{Z}ESCAPED{ }</font>ESCAPED{$test}ESCAPED{)}<font color="#999999">:ESCAPED{int}</font> +|--dnfType1 [1674, 1682] : ESCAPED{dnfType1}ESCAPED{(}ESCAPED{$param1}ESCAPED{, }<font color="#999999">ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}ESCAPED{(}ESCAPED{Y}ESCAPED{&}ESCAPED{Z}ESCAPED{)}ESCAPED{|}ESCAPED{Z}ESCAPED{ }</font>ESCAPED{$param2}ESCAPED{)}<font color="#999999">:ESCAPED{(\X&\Y)}ESCAPED{|}ESCAPED{(\Y&\Z)}ESCAPED{|}ESCAPED{(\X&\Z)}</font> +|--dnfType2 [1750, 1758] : ESCAPED{dnfType2}ESCAPED{(}ESCAPED{$param1}ESCAPED{, }<font color="#999999">ESCAPED{X}ESCAPED{|}ESCAPED{(}ESCAPED{Y}ESCAPED{&}ESCAPED{Z}ESCAPED{)}ESCAPED{|}ESCAPED{Z}ESCAPED{ }</font>ESCAPED{$param2}ESCAPED{)}<font color="#999999">:ESCAPED{\Y}ESCAPED{|}ESCAPED{(\Y&\Z)}ESCAPED{|}ESCAPED{\X}</font> +|--staticTestVoid [1819, 1833] : ESCAPED{staticTestVoid}ESCAPED{(}<font color="#999999">ESCAPED{(}ESCAPED{Test}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}ESCAPED{Z}ESCAPED{|}ESCAPED{X}ESCAPED{ }</font>ESCAPED{$test}ESCAPED{)}<font color="#999999">:ESCAPED{void}</font> +|--staticTestType [1889, 1903] : ESCAPED{staticTestType}ESCAPED{(}<font color="#999999">ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}ESCAPED{(}ESCAPED{Y}ESCAPED{&}ESCAPED{Z}ESCAPED{)}ESCAPED{|}ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Z}ESCAPED{)}ESCAPED{ }</font>ESCAPED{$param1}ESCAPED{, }<font color="#999999">ESCAPED{int}ESCAPED{ }</font>ESCAPED{$param2}ESCAPED{)}<font color="#999999">:ESCAPED{int}</font> +|--staticDnfType1 [1994, 2008] : ESCAPED{staticDnfType1}ESCAPED{(}<font color="#999999">ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}ESCAPED{(}ESCAPED{Y}ESCAPED{&}ESCAPED{Z}ESCAPED{)}ESCAPED{|}ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Z}ESCAPED{)}ESCAPED{ }</font>ESCAPED{$param1}ESCAPED{, }<font color="#999999">ESCAPED{int}ESCAPED{ }</font>ESCAPED{$param2}ESCAPED{)}<font color="#999999">:ESCAPED{(\X&\Y)}ESCAPED{|}ESCAPED{(\Y&\Z)}ESCAPED{|}ESCAPED{(\X&\Z)}</font> +|--staticDnfType2 [2091, 2105] : ESCAPED{staticDnfType2}ESCAPED{(}<font color="#999999">ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}ESCAPED{(}ESCAPED{Y}ESCAPED{&}ESCAPED{Z}ESCAPED{)}ESCAPED{|}ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Z}ESCAPED{)}ESCAPED{ }</font>ESCAPED{$param1}ESCAPED{, }<font color="#999999">ESCAPED{int}ESCAPED{ }</font>ESCAPED{$param2}ESCAPED{)}<font color="#999999">:ESCAPED{\X}ESCAPED{|}ESCAPED{(\Y&\Z)}ESCAPED{|}ESCAPED{\Z}</font> +|--staticDnfType3 [2186, 2200] : ESCAPED{staticDnfType3}ESCAPED{(}<font color="#999999">ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}ESCAPED{(}ESCAPED{Y}ESCAPED{&}ESCAPED{Z}ESCAPED{)}ESCAPED{|}ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Z}ESCAPED{)}ESCAPED{ }</font>ESCAPED{$param1}ESCAPED{, }<font color="#999999">ESCAPED{int}ESCAPED{ }</font>ESCAPED{$param2}ESCAPED{)}<font color="#999999">:ESCAPED{\X}ESCAPED{|}ESCAPED{(\Y&\Z)}</font> +|--staticTestNullable [2278, 2296] : ESCAPED{staticTestNullable}ESCAPED{(}<font color="#999999">ESCAPED{?}ESCAPED{string}ESCAPED{ }</font>ESCAPED{$param}ESCAPED{, }<font color="#999999">ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}ESCAPED{Y}ESCAPED{|}ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Z}ESCAPED{)}ESCAPED{ }</font>ESCAPED{$param2}ESCAPED{)}<font color="#999999">:ESCAPED{?}ESCAPED{int}</font> +|--getDefault [2376, 2386] : ESCAPED{getDefault}ESCAPED{(}ESCAPED{)}<font color="#999999">:ESCAPED{?}ESCAPED{\Example}</font> diff --git a/php/php.editor/test/unit/data/testfiles/index/testGetEnums/testGetEnums.php.indexed b/php/php.editor/test/unit/data/testfiles/index/testGetEnums/testGetEnums.php.indexed index 40221d31e3..1be53630fc 100644 --- a/php/php.editor/test/unit/data/testfiles/index/testGetEnums/testGetEnums.php.indexed +++ b/php/php.editor/test/unit/data/testfiles/index/testGetEnums/testGetEnums.php.indexed @@ -13,7 +13,7 @@ Searchable Keys: enum : attributes;Attributes;1491;;int;Iface|\Iface;1;;0;<TESTURL>/testGetEnums.php; enum.case : a;A;1545;1;0;<TESTURL>/testGetEnums.php;1; enum.case : b;B;1571;2;0;<TESTURL>/testGetEnums.php;1; - method : implmethod;implMethod;1685;$test:Test:1::1:0:0:0:0:0;void;1;0;<TESTURL>/testGetEnums.php;0;0;void; + method : implmethod;implMethod;1685;$test:Test:1::1:0:0:0:0:0:Test:;void;1;0;<TESTURL>/testGetEnums.php;0;0;void; superiface : iface;Iface; top : attributes @@ -74,7 +74,7 @@ Searchable Keys: enum.case : a;A;1392;?;0;<TESTURL>/testGetEnums.php;1; enum.case : b;B;1404;?;0;<TESTURL>/testGetEnums.php;1; enum.case : c;C;1416;?;0;<TESTURL>/testGetEnums.php;1; - method : implmethod;implMethod;1440;$test:Test:1::1:0:0:0:0:0;void;1;0;<TESTURL>/testGetEnums.php;0;0;void; + method : implmethod;implMethod;1440;$test:Test:1::1:0:0:0:0:0:Test:;void;1;0;<TESTURL>/testGetEnums.php;0;0;void; superiface : iface1;Iface1; superiface : iface2;Iface2; top : impl diff --git a/php/php.editor/test/unit/data/testfiles/index/testGetFunctions/testGetFunctions.php.indexed b/php/php.editor/test/unit/data/testfiles/index/testGetFunctions/testGetFunctions.php.indexed index 33285e1f11..4315895420 100644 --- a/php/php.editor/test/unit/data/testfiles/index/testGetFunctions/testGetFunctions.php.indexed +++ b/php/php.editor/test/unit/data/testfiles/index/testGetFunctions/testGetFunctions.php.indexed @@ -2,7 +2,7 @@ Document 0 Searchable Keys: - base : af;af;71;$pClass:ParameterClass:1::1:0:0:0:0:0,$pIface:ParameterIface:1::1:0:0:0:0:0,$pDefault::0:"test":0:0:0:0:0:0,$pConstDefault::0:MY_CONST:0:0:0:0:0:0;;;0;<TESTURL>/testGetFunctions.php;0;0;; + base : af;af;71;$pClass:ParameterClass:1::1:0:0:0:0:0:ParameterClass:,$pIface:ParameterIface:1::1:0:0:0:0:0:ParameterIface:,$pDefault::0:"test":0:0:0:0:0:0::,$pConstDefault::0:MY_CONST:0:0:0:0:0:0::;;;0;<TESTURL>/testGetFunctions.php;0;0;; base : bf;bf;183;;;;0;<TESTURL>/testGetFunctions.php;0;0;; base : cf;cf;202;;;;0;<TESTURL>/testGetFunctions.php;0;0;; top : af diff --git a/php/php.editor/test/unit/data/testfiles/index/testIssue240824/testIssue240824.php.indexed b/php/php.editor/test/unit/data/testfiles/index/testIssue240824/testIssue240824.php.indexed index 0b04b81e1d..f31afe1a79 100644 --- a/php/php.editor/test/unit/data/testfiles/index/testIssue240824/testIssue240824.php.indexed +++ b/php/php.editor/test/unit/data/testfiles/index/testIssue240824/testIssue240824.php.indexed @@ -9,7 +9,7 @@ Not Searchable Keys: Document 1 Searchable Keys: clz : myconfig;MyConfig;13;;;;1;;0;<TESTURL>/testIssue240824.php;; - method : functionname;functionName;109;$param::0::1:0:0:0:0:0;;1;0;<TESTURL>/testIssue240824.php;0;0;; + method : functionname;functionName;109;$param::0::1:0:0:0:0:0::;;1;0;<TESTURL>/testIssue240824.php;0;0;; top : myconfig Not Searchable Keys: diff --git a/php/php.editor/test/unit/data/testfiles/index/testNullableTypesForFunctions/testNullableTypesForFunctions.php.indexed b/php/php.editor/test/unit/data/testfiles/index/testNullableTypesForFunctions/testNullableTypesForFunctions.php.indexed index dcdf844a6c..d6ee65e614 100644 --- a/php/php.editor/test/unit/data/testfiles/index/testNullableTypesForFunctions/testNullableTypesForFunctions.php.indexed +++ b/php/php.editor/test/unit/data/testfiles/index/testNullableTypesForFunctions/testNullableTypesForFunctions.php.indexed @@ -2,8 +2,8 @@ Document 0 Searchable Keys: - base : parametertype;parameterType;16;$msg:?string:1::1:0:0:0:0:0,$num:int:1::1:0:0:0:0:0;;;0;<TESTURL>/testNullableTypesForFunctions.php;0;0;; - base : returntype;returnType;68;$str:string:1::1:0:0:0:0:0;?\Foo;;0;<TESTURL>/testNullableTypesForFunctions.php;0;0;?Foo; + base : parametertype;parameterType;16;$msg:?string:1::1:0:0:0:0:0:?string:,$num:int:1::1:0:0:0:0:0:int:;;;0;<TESTURL>/testNullableTypesForFunctions.php;0;0;; + base : returntype;returnType;68;$str:string:1::1:0:0:0:0:0:string:;?\Foo;;0;<TESTURL>/testNullableTypesForFunctions.php;0;0;?Foo; top : parametertype top : returntype diff --git a/php/php.editor/test/unit/data/testfiles/index/testNullableTypesForMethods/testNullableTypesForMethods.php.indexed b/php/php.editor/test/unit/data/testfiles/index/testNullableTypesForMethods/testNullableTypesForMethods.php.indexed index 8bc49e6d74..1825324682 100644 --- a/php/php.editor/test/unit/data/testfiles/index/testNullableTypesForMethods/testNullableTypesForMethods.php.indexed +++ b/php/php.editor/test/unit/data/testfiles/index/testNullableTypesForMethods/testNullableTypesForMethods.php.indexed @@ -9,10 +9,10 @@ Not Searchable Keys: Document 1 Searchable Keys: clz : nullabletypes;NullableTypes;12;;;;1;;0;<TESTURL>/testNullableTypesForMethods.php;; - method : parametertype;parameterType;49;$param:?string:1::1:0:0:0:0:0;;1;0;<TESTURL>/testNullableTypesForMethods.php;0;0;; - method : parametertypestatic;parameterTypeStatic;115;$param:?string:1::1:0:0:0:0:0;;9;0;<TESTURL>/testNullableTypesForMethods.php;0;0;; - method : returntype;returnType;180;$num:int:1::1:0:0:0:0:0;?\Foo;1;0;<TESTURL>/testNullableTypesForMethods.php;0;0;?\Foo; - method : returntypestatic;returnTypeStatic;245;$num:int:1::1:0:0:0:0:0;?\Foo;9;0;<TESTURL>/testNullableTypesForMethods.php;0;0;?Foo; + method : parametertype;parameterType;49;$param:?string:1::1:0:0:0:0:0:?string:;;1;0;<TESTURL>/testNullableTypesForMethods.php;0;0;; + method : parametertypestatic;parameterTypeStatic;115;$param:?string:1::1:0:0:0:0:0:?string:;;9;0;<TESTURL>/testNullableTypesForMethods.php;0;0;; + method : returntype;returnType;180;$num:int:1::1:0:0:0:0:0:int:;?\Foo;1;0;<TESTURL>/testNullableTypesForMethods.php;0;0;?\Foo; + method : returntypestatic;returnTypeStatic;245;$num:int:1::1:0:0:0:0:0:int:;?\Foo;9;0;<TESTURL>/testNullableTypesForMethods.php;0;0;?Foo; top : nullabletypes Not Searchable Keys: diff --git a/php/php.editor/test/unit/data/testfiles/index/testPHP80ConstructorPropertyPromotion/testPHP80ConstructorPropertyPromotion.php.indexed b/php/php.editor/test/unit/data/testfiles/index/testPHP80ConstructorPropertyPromotion/testPHP80ConstructorPropertyPromotion.php.indexed index 911c79da49..918e5b04d4 100644 --- a/php/php.editor/test/unit/data/testfiles/index/testPHP80ConstructorPropertyPromotion/testPHP80ConstructorPropertyPromotion.php.indexed +++ b/php/php.editor/test/unit/data/testfiles/index/testPHP80ConstructorPropertyPromotion/testPHP80ConstructorPropertyPromotion.php.indexed @@ -5,11 +5,11 @@ Searchable Keys: clz : #anon#testphp80constructorpropertypromotion_php#1;#anon#testPHP80ConstructorPropertyPromotion_php#1;2162;;;;1;;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;; field : x;x;2231;1;int;int;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0; field : y;y;2254;1;int;int;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0; - method : __construct;__construct;2198;$x:int:1::1:0:0:0:1:0,$y:int:1:0:0:0:0:0:1:0;;1;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0;0;; + method : __construct;__construct;2198;$x:int:1::1:0:0:0:1:0:int:,$y:int:1:0:0:0:0:0:1:0:int:;;1;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0;0;; top : #anon#testphp80constructorpropertypromotion_php#1 Not Searchable Keys: - constructor : #anon#testphp80constructorpropertypromotion_php#1;#anon#testPHP80ConstructorPropertyPromotion_php#1;2198;$x:int:1::1:0:0:0:1:0,$y:int:1:0:0:0:0:0:1:0;;1;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0;0;;; + constructor : #anon#testphp80constructorpropertypromotion_php#1;#anon#testPHP80ConstructorPropertyPromotion_php#1;2198;$x:int:1::1:0:0:0:1:0:int:,$y:int:1:0:0:0:0:0:1:0:int:;;1;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0;0;;; Document 1 @@ -22,11 +22,11 @@ Searchable Keys: field : param5;param5;1039;2;?string;?string;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0; field : param6;param6;1077;1;string;string;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0; field : param7;param7;1130;1;string|int;string|int;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0; - method : __construct;__construct;874;$param1::0::1:0:0:0:1:0,$param2:int:1::1:0:0:0:4:0,$param3:int|string:1::1:0:0:1:2:0,$param4:float:1:1:0:1:0:0:2:0,$param5:?string:1:null:0:0:0:0:2:0,$param6:string:1:"default value":0:0:0:0:1:0,$param7:string|int:1:"default value":0:0:0:1:1:0;;1;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0;0;; + method : __construct;__construct;874;$param1::0::1:0:0:0:1:0::,$param2:int:1::1:0:0:0:4:0:int:,$param3:int|string:1::1:0:0:1:2:0:int|string:,$param4:float:1:1:0:1:0:0:2:0:float:,$param5:?string:1:null:0:0:0:0:2:0:?string:,$param6:string:1:"default value":0:0:0:0:1:0:string:,$param7:string|int:1:"default value":0:0:0:1:1:0:string|int:;;1;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0;0;; top : constructorpropertypromotion Not Searchable Keys: - constructor : $param2:int:1::1:0:0:0:4:0,$param3:int|string:1::1:0:0:1:2:0,$param4:float:1:1:0:1:0:0:2:0,$param5:?string:1:null:0:0:0:0:2:0,$param6:string:1:"default value":0:0:0:0:1:0,$param7:string|int:1:"default value":0:0:0:1:1:0;;1;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0;0;;;,constructorpropertypromotion;ConstructorPropertyPromotion;874;$param1::0::1:0:0:0:1:0 + constructor : $param2:int:1::1:0:0:0:4:0:int:,$param3:int|string:1::1:0:0:1:2:0:int|string:,$param4:float:1:1:0:1:0:0:2:0:float:,$param5:?string:1:null:0:0:0:0:2:0:?string:,$param6:string:1:"default value":0:0:0:0:1:0:string:,$param7:string|int:1:"default value":0:0:0:1:1:0:string|int:;;1;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0;0;;;,constructorpropertypromotion;ConstructorPropertyPromotion;874;$param1::0::1:0:0:0:1:0:: Document 2 @@ -34,11 +34,11 @@ Searchable Keys: clz : constructorpropertypromotionclass2;ConstructorPropertyPromotionClass2;1929;;;;1;;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;; field : param2;param2;2037;1;int;int;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0; field : param4;param4;2110;1;string;string;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0; - method : __construct;__construct;1987;$param1::0::1:0:0:0:0:0,$param2:int:1::1:0:0:0:1:0,$param3:string:1:"default value":0:0:0:0:0:0,$param4:string:1:"default value":0:0:0:0:1:0;;1;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0;0;; + method : __construct;__construct;1987;$param1::0::1:0:0:0:0:0::,$param2:int:1::1:0:0:0:1:0:int:,$param3:string:1:"default value":0:0:0:0:0:0:string:,$param4:string:1:"default value":0:0:0:0:1:0:string:;;1;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0;0;; top : constructorpropertypromotionclass2 Not Searchable Keys: - constructor : $param2:int:1::1:0:0:0:1:0,$param3:string:1:"default value":0:0:0:0:0:0,$param4:string:1:"default value":0:0:0:0:1:0;;1;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0;0;;;,constructorpropertypromotionclass2;ConstructorPropertyPromotionClass2;1987;$param1::0::1:0:0:0:0:0 + constructor : $param2:int:1::1:0:0:0:1:0:int:,$param3:string:1:"default value":0:0:0:0:0:0:string:,$param4:string:1:"default value":0:0:0:0:1:0:string:;;1;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0;0;;;,constructorpropertypromotionclass2;ConstructorPropertyPromotionClass2;1987;$param1::0::1:0:0:0:0:0:: Document 3 @@ -51,11 +51,11 @@ Searchable Keys: field : param5;param5;1360;2;?string;?string;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0; field : param6;param6;1387;1;string;string;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0; field : param7;param7;1418;1;string|int;string|int;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0; - method : __construct;__construct;1447;$param1::0::1:0:0:0:0:0,$param2:int:1::1:0:0:0:0:0,$param3:int|string:1::1:0:0:1:0:0,$param4:float:1:1:0:1:0:0:0:0,$param5:?string:1:null:0:0:0:0:0:0,$param6:string:1:"default value":0:0:0:0:0:0,$param7:string|int:1:"default value":0:0:0:1:0:0;;1;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0;0;; + method : __construct;__construct;1447;$param1::0::1:0:0:0:0:0::,$param2:int:1::1:0:0:0:0:0:int:,$param3:int|string:1::1:0:0:1:0:0:int|string:,$param4:float:1:1:0:1:0:0:0:0:float:,$param5:?string:1:null:0:0:0:0:0:0:?string:,$param6:string:1:"default value":0:0:0:0:0:0:string:,$param7:string|int:1:"default value":0:0:0:1:0:0:string|int:;;1;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0;0;; top : legacysyntax Not Searchable Keys: - constructor : $param2:int:1::1:0:0:0:0:0,$param3:int|string:1::1:0:0:1:0:0,$param4:float:1:1:0:1:0:0:0:0,$param5:?string:1:null:0:0:0:0:0:0,$param6:string:1:"default value":0:0:0:0:0:0,$param7:string|int:1:"default value":0:0:0:1:0:0;;1;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0;0;;;,legacysyntax;LegacySyntax;1447;$param1::0::1:0:0:0:0:0 + constructor : $param2:int:1::1:0:0:0:0:0:int:,$param3:int|string:1::1:0:0:1:0:0:int|string:,$param4:float:1:1:0:1:0:0:0:0:float:,$param5:?string:1:null:0:0:0:0:0:0:?string:,$param6:string:1:"default value":0:0:0:0:0:0:string:,$param7:string|int:1:"default value":0:0:0:1:0:0:string|int:;;1;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0;0;;;,legacysyntax;LegacySyntax;1447;$param1::0::1:0:0:0:0:0:: Document 4 @@ -67,12 +67,12 @@ Searchable Keys: field : param5;param5;2507;2;?string;?string;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0; field : param6;param6;2545;1;string;string;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0; field : param7;param7;2598;1;string|int;string|int;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0; - method : __construct;__construct;2342;$param1::0::1:0:0:0:1:0,$param2:int:1::1:0:0:0:4:0,$param3:int|string:1::1:0:0:1:2:0,$param4:float:1:1:0:1:0:0:2:0,$param5:?string:1:null:0:0:0:0:2:0,$param6:string:1:"default value":0:0:0:0:1:0,$param7:string|int:1:"default value":0:0:0:1:1:0;;1;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0;0;; + method : __construct;__construct;2342;$param1::0::1:0:0:0:1:0::,$param2:int:1::1:0:0:0:4:0:int:,$param3:int|string:1::1:0:0:1:2:0:int|string:,$param4:float:1:1:0:1:0:0:2:0:float:,$param5:?string:1:null:0:0:0:0:2:0:?string:,$param6:string:1:"default value":0:0:0:0:1:0:string:,$param7:string|int:1:"default value":0:0:0:1:1:0:string|int:;;1;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0;0;; top : constructorpropertypromotiontrait trait : constructorpropertypromotiontrait;ConstructorPropertyPromotionTrait;2285;;;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php; Not Searchable Keys: - constructor : $param2:int:1::1:0:0:0:4:0,$param3:int|string:1::1:0:0:1:2:0,$param4:float:1:1:0:1:0:0:2:0,$param5:?string:1:null:0:0:0:0:2:0,$param6:string:1:"default value":0:0:0:0:1:0,$param7:string|int:1:"default value":0:0:0:1:1:0;;1;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0;0;;;,constructorpropertypromotiontrait;ConstructorPropertyPromotionTrait;2342;$param1::0::1:0:0:0:1:0 + constructor : $param2:int:1::1:0:0:0:4:0:int:,$param3:int|string:1::1:0:0:1:2:0:int|string:,$param4:float:1:1:0:1:0:0:2:0:float:,$param5:?string:1:null:0:0:0:0:2:0:?string:,$param6:string:1:"default value":0:0:0:0:1:0:string:,$param7:string|int:1:"default value":0:0:0:1:1:0:string|int:;;1;0;<TESTURL>/testPHP80ConstructorPropertyPromotion.php;0;0;;;,constructorpropertypromotiontrait;ConstructorPropertyPromotionTrait;2342;$param1::0::1:0:0:0:1:0:: Document 5 diff --git a/php/php.editor/test/unit/data/testfiles/index/testPHP80UnionTypesFunctions/testPHP80UnionTypesFunctions.php.indexed b/php/php.editor/test/unit/data/testfiles/index/testPHP80UnionTypesFunctions/testPHP80UnionTypesFunctions.php.indexed index 2e095d224b..6a290003b8 100644 --- a/php/php.editor/test/unit/data/testfiles/index/testPHP80UnionTypesFunctions/testPHP80UnionTypesFunctions.php.indexed +++ b/php/php.editor/test/unit/data/testfiles/index/testPHP80UnionTypesFunctions/testPHP80UnionTypesFunctions.php.indexed @@ -2,12 +2,12 @@ Document 0 Searchable Keys: - base : arrowfunctiondeclaration:1205;ArrowFunctionDeclaration:1205;1205;$param:int|float:1::1:0:0:1:0:0;string|false;;0;<TESTURL>/testPHP80UnionTypesFunctions.php;1;0;string|false; - base : arrowfunctiondeclaration:1262;ArrowFunctionDeclaration:1262;1262;$param:int|float:1::1:0:0:1:0:0;\Test1\Foo|\Test2\Bar|string;;0;<TESTURL>/testPHP80UnionTypesFunctions.php;1;0;\Test1\Foo|\Test2\Bar|string; - base : lambdafunctiondeclaration:1030;LambdaFunctionDeclaration:1030;1030;$number:int|float|null:1::1:0:0:1:0:0;Foo|Bar;;0;<TESTURL>/testPHP80UnionTypesFunctions.php;1;0;Foo|Bar; - base : lambdafunctiondeclaration:1112;LambdaFunctionDeclaration:1112;1112;$number:int|float|null:1::1:0:0:1:0:0;\Test1\Foo|\Test2\Bar;;0;<TESTURL>/testPHP80UnionTypesFunctions.php;1;0;\Test1\Foo|\Test2\Bar; - base : union_types;union_types;824;$number:int|float:1::1:0:0:1:0:0,$param:Foo|Bar|null:1::1:0:0:1:0:0;int|float|\Foo;;0;<TESTURL>/testPHP80UnionTypesFunctions.php;1;0;int|float|Foo; - base : union_types;union_types;919;$number:int|float:1::1:0:0:1:0:0,$param:\Test1|Foo|Bar|null:1::1:0:0:1:0:0;int|float|\Test1\Foo;;0;<TESTURL>/testPHP80UnionTypesFunctions.php;1;0;int|float|\Test1\Foo; + base : arrowfunctiondeclaration:1205;ArrowFunctionDeclaration:1205;1205;$param:int|float:1::1:0:0:1:0:0:int|float:;string|false;;0;<TESTURL>/testPHP80UnionTypesFunctions.php;1;0;string|false; + base : arrowfunctiondeclaration:1262;ArrowFunctionDeclaration:1262;1262;$param:int|float:1::1:0:0:1:0:0:int|float:;\Test1\Foo|\Test2\Bar|string;;0;<TESTURL>/testPHP80UnionTypesFunctions.php;1;0;\Test1\Foo|\Test2\Bar|string; + base : lambdafunctiondeclaration:1030;LambdaFunctionDeclaration:1030;1030;$number:int|float|null:1::1:0:0:1:0:0:int|float|null:;Foo|Bar;;0;<TESTURL>/testPHP80UnionTypesFunctions.php;1;0;Foo|Bar; + base : lambdafunctiondeclaration:1112;LambdaFunctionDeclaration:1112;1112;$number:int|float|null:1::1:0:0:1:0:0:int|float|null:;\Test1\Foo|\Test2\Bar;;0;<TESTURL>/testPHP80UnionTypesFunctions.php;1;0;\Test1\Foo|\Test2\Bar; + base : union_types;union_types;824;$number:int|float:1::1:0:0:1:0:0:int|float:,$param:Foo|Bar|null:1::1:0:0:1:0:0:Foo|Bar|null:;int|float|\Foo;;0;<TESTURL>/testPHP80UnionTypesFunctions.php;1;0;int|float|Foo; + base : union_types;union_types;919;$number:int|float:1::1:0:0:1:0:0:int|float:,$param:\Test1|Foo|Bar|null:1::1:0:0:1:0:0:\Test1|Foo|Bar|null:;int|float|\Test1\Foo;;0;<TESTURL>/testPHP80UnionTypesFunctions.php;1;0;int|float|\Test1\Foo; top : $arrow top : $arrow2 top : $closure diff --git a/php/php.editor/test/unit/data/testfiles/index/testPHP80UnionTypesTypes/testPHP80UnionTypesTypes.php.indexed b/php/php.editor/test/unit/data/testfiles/index/testPHP80UnionTypesTypes/testPHP80UnionTypesTypes.php.indexed index b0cca1e4b8..6eb4be4b96 100644 --- a/php/php.editor/test/unit/data/testfiles/index/testPHP80UnionTypesTypes/testPHP80UnionTypesTypes.php.indexed +++ b/php/php.editor/test/unit/data/testfiles/index/testPHP80UnionTypesTypes/testPHP80UnionTypesTypes.php.indexed @@ -11,8 +11,8 @@ Searchable Keys: clz : uniontypesabstractclass;UnionTypesAbstractClass;1150;;;;1025;;0;<TESTURL>/testPHP80UnionTypesTypes.php;; field : property;property;1199;2;int|float;int|float;0;<TESTURL>/testPHP80UnionTypesTypes.php;0; field : staticproperty;staticProperty;1248;12;string|bool|null;string|bool|null;0;<TESTURL>/testPHP80UnionTypesTypes.php;0; - method : method;method;1294;$number:int|float:1::1:0:0:1:0:0;\Foo|\Bar|null;1025;0;<TESTURL>/testPHP80UnionTypesTypes.php;1;0;Foo|Bar|null; - method : staticmethod;staticMethod;1375;$iterable:iterable|null:1::1:0:0:1:0:0;\Test\Foo|\Bar;1036;0;<TESTURL>/testPHP80UnionTypesTypes.php;1;0;\Test\Foo|Bar; + method : method;method;1294;$number:int|float:1::1:0:0:1:0:0:int|float:;\Foo|\Bar|null;1025;0;<TESTURL>/testPHP80UnionTypesTypes.php;1;0;Foo|Bar|null; + method : staticmethod;staticMethod;1375;$iterable:iterable|null:1::1:0:0:1:0:0:iterable|null:;\Test\Foo|\Bar;1036;0;<TESTURL>/testPHP80UnionTypesTypes.php;1;0;\Test\Foo|Bar; top : uniontypesabstractclass Not Searchable Keys: @@ -23,8 +23,8 @@ Searchable Keys: clz : uniontypesclass;UnionTypesClass;821;;;;1;;0;<TESTURL>/testPHP80UnionTypesTypes.php;; field : property;property;862;2;int|float;int|float;0;<TESTURL>/testPHP80UnionTypesTypes.php;0; field : staticproperty;staticProperty;911;12;string|bool|null;string|bool|null;0;<TESTURL>/testPHP80UnionTypesTypes.php;0; - method : method;method;948;$number:int|float:1::1:0:0:1:0:0;\Foo|\Bar|null;1;0;<TESTURL>/testPHP80UnionTypesTypes.php;1;0;Foo|Bar|null; - method : staticmethod;staticMethod;1045;$iterable:iterable|null:1::1:0:0:1:0:0;\Test\Foo|\Bar;9;0;<TESTURL>/testPHP80UnionTypesTypes.php;1;0;\Test\Foo|Bar; + method : method;method;948;$number:int|float:1::1:0:0:1:0:0:int|float:;\Foo|\Bar|null;1;0;<TESTURL>/testPHP80UnionTypesTypes.php;1;0;Foo|Bar|null; + method : staticmethod;staticMethod;1045;$iterable:iterable|null:1::1:0:0:1:0:0:iterable|null:;\Test\Foo|\Bar;9;0;<TESTURL>/testPHP80UnionTypesTypes.php;1;0;\Test\Foo|Bar; top : uniontypesclass Not Searchable Keys: @@ -34,8 +34,8 @@ Document 3 Searchable Keys: field : property;property;1657;2;int|float;int|float;0;<TESTURL>/testPHP80UnionTypesTypes.php;0; field : staticproperty;staticProperty;1706;12;string|bool|null;string|bool|null;0;<TESTURL>/testPHP80UnionTypesTypes.php;0; - method : method;method;1743;$number:int|float:1::1:0:0:1:0:0;\Foo|\Bar|null;1;0;<TESTURL>/testPHP80UnionTypesTypes.php;1;0;Foo|Bar|null; - method : staticmethod;staticMethod;1840;$iterable:iterable|null:1::1:0:0:1:0:0;\Test\Foo|\Bar;9;0;<TESTURL>/testPHP80UnionTypesTypes.php;1;0;\Test\Foo|Bar; + method : method;method;1743;$number:int|float:1::1:0:0:1:0:0:int|float:;\Foo|\Bar|null;1;0;<TESTURL>/testPHP80UnionTypesTypes.php;1;0;Foo|Bar|null; + method : staticmethod;staticMethod;1840;$iterable:iterable|null:1::1:0:0:1:0:0:iterable|null:;\Test\Foo|\Bar;9;0;<TESTURL>/testPHP80UnionTypesTypes.php;1;0;\Test\Foo|Bar; top : uniontypestrait trait : uniontypestrait;UnionTypesTrait;1616;;;0;<TESTURL>/testPHP80UnionTypesTypes.php; @@ -136,8 +136,8 @@ Not Searchable Keys: Document 5 Searchable Keys: iface : uniontypesinterface;UnionTypesInterface;1442;;;0;<TESTURL>/testPHP80UnionTypesTypes.php; - method : method;method;1484;$number:int|float:1::1:0:0:1:0:0;\Foo|\Bar|null;1025;0;<TESTURL>/testPHP80UnionTypesTypes.php;1;0;Foo|Bar|null; - method : staticmethod;staticMethod;1553;$iterable:iterable|null:1::1:0:0:1:0:0;\Test\Foo|\Bar;1033;0;<TESTURL>/testPHP80UnionTypesTypes.php;1;0;\Test\Foo|Bar; + method : method;method;1484;$number:int|float:1::1:0:0:1:0:0:int|float:;\Foo|\Bar|null;1025;0;<TESTURL>/testPHP80UnionTypesTypes.php;1;0;Foo|Bar|null; + method : staticmethod;staticMethod;1553;$iterable:iterable|null:1::1:0:0:1:0:0:iterable|null:;\Test\Foo|\Bar;1033;0;<TESTURL>/testPHP80UnionTypesTypes.php;1;0;\Test\Foo|Bar; top : uniontypesinterface Not Searchable Keys: diff --git a/php/php.editor/test/unit/data/testfiles/index/testPHP81PureIntersectionTypes/testPHP81PureIntersectionTypes.php.indexed b/php/php.editor/test/unit/data/testfiles/index/testPHP81PureIntersectionTypes/testPHP81PureIntersectionTypes.php.indexed index 80d20d38d4..a4f462d8fd 100644 --- a/php/php.editor/test/unit/data/testfiles/index/testPHP81PureIntersectionTypes/testPHP81PureIntersectionTypes.php.indexed +++ b/php/php.editor/test/unit/data/testfiles/index/testPHP81PureIntersectionTypes/testPHP81PureIntersectionTypes.php.indexed @@ -2,11 +2,11 @@ Document 0 Searchable Keys: - base : arrowfunctiondeclaration:1578;ArrowFunctionDeclaration:1578;1578;$test:X&Y:1::1:0:0:0:0:1;;;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;0;; - base : arrowfunctiondeclaration:1611;ArrowFunctionDeclaration:1611;1611;$test:X&Y:1::1:0:0:0:0:1;X&Y;;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;1;X&Y; - base : lambdafunctiondeclaration:1481;LambdaFunctionDeclaration:1481;1481;$test1:X&Y&Z:1::1:0:0:0:0:1,$test2:Y&Z:1::1:0:0:0:0:1;void;;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;0;void; - base : lambdafunctiondeclaration:1537;LambdaFunctionDeclaration:1537;1537;$test:int:1::1:0:0:0:0:0;X&Y&Z;;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;1;X&Y&Z; - base : paramtype;paramType;857;$test:X&Y:1::1:0:0:0:0:1;void;;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;0;void; + base : arrowfunctiondeclaration:1578;ArrowFunctionDeclaration:1578;1578;$test:X&Y:1::1:0:0:0:0:1:X&Y:;;;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;0;; + base : arrowfunctiondeclaration:1611;ArrowFunctionDeclaration:1611;1611;$test:X&Y:1::1:0:0:0:0:1:X&Y:;X&Y;;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;1;X&Y; + base : lambdafunctiondeclaration:1481;LambdaFunctionDeclaration:1481;1481;$test1:X&Y&Z:1::1:0:0:0:0:1:X&Y&Z:,$test2:Y&Z:1::1:0:0:0:0:1:Y&Z:;void;;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;0;void; + base : lambdafunctiondeclaration:1537;LambdaFunctionDeclaration:1537;1537;$test:int:1::1:0:0:0:0:0:int:;X&Y&Z;;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;1;X&Y&Z; + base : paramtype;paramType;857;$test:X&Y:1::1:0:0:0:0:1:X&Y:;void;;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;0;void; base : returntype;returnType;903;;\X&\Y;;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;1;X&Y; top : $arrow top : $closure @@ -26,7 +26,7 @@ Document 1 Searchable Keys: clz : testclass;TestClass;937;;;;1;;0;<TESTURL>/testPHP81PureIntersectionTypes.php;; field : test;test;966;2;X&Y;\X&\Y;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0; - method : paramtype;paramType;993;$test:X&Y:1::1:0:0:0:0:1;void;1;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;0;void; + method : paramtype;paramType;993;$test:X&Y:1::1:0:0:0:0:1:X&Y:;void;1;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;0;void; method : returntype;returnType;1078;;\X&\Y;1;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;1;X&Y; top : testclass @@ -60,7 +60,7 @@ Not Searchable Keys: Document 5 Searchable Keys: field : test;test;1170;2;X&Y;\X&\Y;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0; - method : paramtype;paramType;1197;$test1:X&Y:1::1:0:0:0:0:1,$test2:X&Y&Z:1::1:0:0:0:0:1;void;1;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;0;void; + method : paramtype;paramType;1197;$test1:X&Y:1::1:0:0:0:0:1:X&Y:,$test2:X&Y&Z:1::1:0:0:0:0:1:X&Y&Z:;void;1;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;0;void; method : returntype;returnType;1297;;\X&\Y;1;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;1;X&Y; top : testtrait trait : testtrait;TestTrait;1141;;;0;<TESTURL>/testPHP81PureIntersectionTypes.php; @@ -163,7 +163,7 @@ Not Searchable Keys: Document 7 Searchable Keys: iface : testinterfase;TestInterfase;1364;;;0;<TESTURL>/testPHP81PureIntersectionTypes.php; - method : paramtype;paramType;1401;$test:X&Y&Z:1::1:0:0:0:0:1;;1025;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;0;; + method : paramtype;paramType;1401;$test:X&Y&Z:1::1:0:0:0:0:1:X&Y&Z:;;1025;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;0;; method : returntype;returnType;1445;;\X&\Y&\Z;1025;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;1;X&Y&Z; top : testinterfase diff --git a/php/php.editor/test/unit/data/testfiles/index/testPHP82DNFParameterTypes/testPHP82DNFParameterTypes.php b/php/php.editor/test/unit/data/testfiles/index/testPHP82DNFParameterTypes/testPHP82DNFParameterTypes.php new file mode 100644 index 0000000000..6bdc48e3e6 --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/index/testPHP82DNFParameterTypes/testPHP82DNFParameterTypes.php @@ -0,0 +1,69 @@ +<?php +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +class X {} +class Y {} +class Z {} +class Test {} + +function parameterType((X&Y&Test)|(X&Z) $param): void { +} + +class TestClass { + public function parameterType((Test&Y)|Z|X $param1, bool $param2): (Test&Y)|Z|X { + return $this->test; + } +} + +trait TestTrait { + public function parameterType((X&Y)|(Y&Z&Test) $param): self { + return $this->test; + } +} + +interface TestInterfase { + public function parameterType(X|(X&Y&Z)|Z $param); +} + +enum TestEnum { + case Case1; + public function parameterType(X&Y $param1, (X&Y)|Z $param2): (X&Y)|Z {} +} + +$closure = function((X&Y&Z)|(X&Z) $test): (X&Y&Z)|(X&Z) {}; + +$arrow = fn((X&Y)|(Y&Z)|(X&Z) $test): (X&Y)|(Y&Z)|(X&Z) => $test; + +/** + * Magick methods. + * + * @method testVoid((X&Y&Z)|(X&Z) $test) test comment + * @method int testType(X|(X&Y&Z)|Z $test) test comment + * @method (X&Y)|(Y&Z)|(X&Z) dnfType1($param1, (X&Y)|(Y&Z)|Z $param2) test comment + * @method Y|(Y&Z)|X dnfType2($param1, X|(Y&Z)|Z $param2) test comment + * @method static staticTestVoid((Test&Y)|Z|X $test) test comment + * @method static int staticTestType((X&Y)|(Y&Z)|(X&Z) $param1, int $param2) test comment + * @method static (X&Y)|(Y&Z)|(X&Z) staticDnfType1((X&Y)|(Y&Z)|(X&Z) $param1, int $param2) test comment + * @method static X|(Y&Z)|Z staticDnfType2((X&Y)|(Y&Z)|(X&Z) $param1, int $param2) test comment + * @method static X|(Y&Z) staticDnfType3((X&Y)|(Y&Z)|(X&Z) $param1, int $param2) test comment + * @method static ?int staticTestNullable(?string $param, (X&Y)|Y|(X&Z) $param2) test comment + * @method static ?Example getDefault() Description + */ +class MagickMethods { +} diff --git a/php/php.editor/test/unit/data/testfiles/index/testPHP82DNFParameterTypes/testPHP82DNFParameterTypes.php.indexed b/php/php.editor/test/unit/data/testfiles/index/testPHP82DNFParameterTypes/testPHP82DNFParameterTypes.php.indexed new file mode 100644 index 0000000000..f25f5e9dd6 --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/index/testPHP82DNFParameterTypes/testPHP82DNFParameterTypes.php.indexed @@ -0,0 +1,281 @@ + + +Document 0 +Searchable Keys: + base : arrowfunctiondeclaration:1449;ArrowFunctionDeclaration:1449;1449;$test::1::1:0:0:1:0:0:(X&Y)|(Y&Z)|(X&Z):;(X&Y)|(Y&Z)|(X&Z);;0;<TESTURL>/testPHP82DNFParameterTypes.php;1;0;(X&Y)|(Y&Z)|(X&Z); + base : lambdafunctiondeclaration:1390;LambdaFunctionDeclaration:1390;1390;$test::1::1:0:0:1:0:0:(X&Y&Z)|(X&Z):;(X&Y&Z)|(X&Z);;0;<TESTURL>/testPHP82DNFParameterTypes.php;1;0;(X&Y&Z)|(X&Z); + base : parametertype;parameterType;871;$param::1::1:0:0:1:0:0:(X&Y&Test)|(X&Z):;void;;0;<TESTURL>/testPHP82DNFParameterTypes.php;0;0;void; + top : $arrow + top : $closure + top : arrowfunctiondeclaration:1449 + top : lambdafunctiondeclaration:1390 + top : parametertype + var : $arrow;$arrow;;1441;0;<TESTURL>/testPHP82DNFParameterTypes.php; + var : $closure;$closure;;1380;0;<TESTURL>/testPHP82DNFParameterTypes.php; + +Not Searchable Keys: + + +Document 1 +Searchable Keys: + clz : magickmethods;MagickMethods;2411;;;;1;;0;<TESTURL>/testPHP82DNFParameterTypes.php;; + method : dnftype1;dnfType1;1674;$param1::0::1:0:0:0:0:0::,$param2:X|Y|Y|Z|Z:1::1:0:0:0:0:0:(X&Y)|(Y&Z)|Z:(X&Y)|(Y&Z)|Z;(\X&\Y)|(\Y&\Z)|(\X&\Z);1;0;<TESTURL>/testPHP82DNFParameterTypes.php;0;0;; + method : dnftype2;dnfType2;1750;$param1::0::1:0:0:0:0:0::,$param2:X|Y|Z|Z:1::1:0:0:0:0:0:X|(Y&Z)|Z:X|(Y&Z)|Z;\Y|(\Y&\Z)|\X;1;0;<TESTURL>/testPHP82DNFParameterTypes.php;0;0;; + method : getdefault;getDefault;2376;;?\Example;9;0;<TESTURL>/testPHP82DNFParameterTypes.php;0;0;; + method : staticdnftype1;staticDnfType1;1994;$param1:X|Y|Y|Z|X|Z:1::1:0:0:0:0:0:(X&Y)|(Y&Z)|(X&Z):(X&Y)|(Y&Z)|(X&Z),$param2:int:1::1:0:0:0:0:0:int:int;(\X&\Y)|(\Y&\Z)|(\X&\Z);9;0;<TESTURL>/testPHP82DNFParameterTypes.php;0;0;; + method : staticdnftype2;staticDnfType2;2091;$param1:X|Y|Y|Z|X|Z:1::1:0:0:0:0:0:(X&Y)|(Y&Z)|(X&Z):(X&Y)|(Y&Z)|(X&Z),$param2:int:1::1:0:0:0:0:0:int:int;\X|(\Y&\Z)|\Z;9;0;<TESTURL>/testPHP82DNFParameterTypes.php;0;0;; + method : staticdnftype3;staticDnfType3;2186;$param1:X|Y|Y|Z|X|Z:1::1:0:0:0:0:0:(X&Y)|(Y&Z)|(X&Z):(X&Y)|(Y&Z)|(X&Z),$param2:int:1::1:0:0:0:0:0:int:int;\X|(\Y&\Z);9;0;<TESTURL>/testPHP82DNFParameterTypes.php;0;0;; + method : statictestnullable;staticTestNullable;2278;$param:?string:1::1:0:0:0:0:0:?string:?string,$param2:X|Y|Y|X|Z:1::1:0:0:0:0:0:(X&Y)|Y|(X&Z):(X&Y)|Y|(X&Z);?int;9;0;<TESTURL>/testPHP82DNFParameterTypes.php;0;0;; + method : statictesttype;staticTestType;1889;$param1:X|Y|Y|Z|X|Z:1::1:0:0:0:0:0:(X&Y)|(Y&Z)|(X&Z):(X&Y)|(Y&Z)|(X&Z),$param2:int:1::1:0:0:0:0:0:int:int;int;9;0;<TESTURL>/testPHP82DNFParameterTypes.php;0;0;; + method : statictestvoid;staticTestVoid;1819;$test:Test|Y|Z|X:1::1:0:0:0:0:0:(Test&Y)|Z|X:(Test&Y)|Z|X;void;9;0;<TESTURL>/testPHP82DNFParameterTypes.php;0;0;; + method : testtype;testType;1603;$test:X|X|Y|Z|Z:1::1:0:0:0:0:0:X|(X&Y&Z)|Z:X|(X&Y&Z)|Z;int;1;0;<TESTURL>/testPHP82DNFParameterTypes.php;0;0;; + method : testvoid;testVoid;1544;$test:X|Y|Z|X|Z:1::1:0:0:0:0:0:(X&Y&Z)|(X&Z):(X&Y&Z)|(X&Z);void;1;0;<TESTURL>/testPHP82DNFParameterTypes.php;0;0;; + top : magickmethods + +Not Searchable Keys: + + +Document 2 +Searchable Keys: + clz : test;Test;853;;;;1;;0;<TESTURL>/testPHP82DNFParameterTypes.php;; + top : test + +Not Searchable Keys: + + +Document 3 +Searchable Keys: + clz : testclass;TestClass;927;;;;1;;0;<TESTURL>/testPHP82DNFParameterTypes.php;; + method : parametertype;parameterType;959;$param1:Z|X:1::1:0:0:1:0:0:(Test&Y)|Z|X:,$param2:bool:1::1:0:0:0:0:0:bool:;(\Test&\Y)|\Z|\X;1;0;<TESTURL>/testPHP82DNFParameterTypes.php;1;0;(Test&Y)|Z|X; + top : testclass + +Not Searchable Keys: + + +Document 4 +Searchable Keys: + clz : x;X;820;;;;1;;0;<TESTURL>/testPHP82DNFParameterTypes.php;; + top : x + +Not Searchable Keys: + + +Document 5 +Searchable Keys: + clz : y;Y;831;;;;1;;0;<TESTURL>/testPHP82DNFParameterTypes.php;; + top : y + +Not Searchable Keys: + + +Document 6 +Searchable Keys: + clz : z;Z;842;;;;1;;0;<TESTURL>/testPHP82DNFParameterTypes.php;; + top : z + +Not Searchable Keys: + + +Document 7 +Searchable Keys: + enum : testenum;TestEnum;1273;;;;1;;0;<TESTURL>/testPHP82DNFParameterTypes.php; + enum.case : case1;Case1;1293;?;0;<TESTURL>/testPHP82DNFParameterTypes.php;1; + method : parametertype;parameterType;1320;$param1:X&Y:1::1:0:0:0:0:1:X&Y:,$param2:Z:1::1:0:0:1:0:0:(X&Y)|Z:;(\X&\Y)|\Z;1;0;<TESTURL>/testPHP82DNFParameterTypes.php;1;0;(X&Y)|Z; + top : testenum + +Not Searchable Keys: + + +Document 8 +Searchable Keys: + identifier_used : ?example; + identifier_used : ?int; + identifier_used : ?string; + identifier_used : arrow; + identifier_used : bool; + identifier_used : case1; + identifier_used : closure; + identifier_used : int; + identifier_used : int; + identifier_used : int; + identifier_used : int; + identifier_used : int; + identifier_used : int; + identifier_used : magickmethods; + identifier_used : param1; + identifier_used : param1; + identifier_used : param2; + identifier_used : param2; + identifier_used : param; + identifier_used : param; + identifier_used : param; + identifier_used : parametertype; + identifier_used : parametertype; + identifier_used : parametertype; + identifier_used : parametertype; + identifier_used : parametertype; + identifier_used : self; + identifier_used : test; + identifier_used : test; + identifier_used : test; + identifier_used : test; + identifier_used : test; + identifier_used : test; + identifier_used : test; + identifier_used : test; + identifier_used : test; + identifier_used : test; + identifier_used : test; + identifier_used : testclass; + identifier_used : testenum; + identifier_used : testinterfase; + identifier_used : testtrait; + identifier_used : this; + identifier_used : this; + identifier_used : void; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : x; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : y; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + identifier_used : z; + +Not Searchable Keys: + + +Document 9 +Searchable Keys: + iface : testinterfase;TestInterfase;1194;;;0;<TESTURL>/testPHP82DNFParameterTypes.php; + method : parametertype;parameterType;1230;$param:X|Z:1::1:0:0:1:0:0:X|(X&Y&Z)|Z:;;1025;0;<TESTURL>/testPHP82DNFParameterTypes.php;0;0;; + top : testinterfase + +Not Searchable Keys: + + +Document 10 +Searchable Keys: + method : parametertype;parameterType;1100;$param::1::1:0:0:1:0:0:(X&Y)|(Y&Z&Test):;\self;1;0;<TESTURL>/testPHP82DNFParameterTypes.php;0;0;self; + top : testtrait + trait : testtrait;TestTrait;1068;;;0;<TESTURL>/testPHP82DNFParameterTypes.php; + +Not Searchable Keys: diff --git a/php/php.editor/test/unit/data/testfiles/index/testPHP82DNFReturnTypes/testPHP82DNFReturnTypes.php.indexed b/php/php.editor/test/unit/data/testfiles/index/testPHP82DNFReturnTypes/testPHP82DNFReturnTypes.php.indexed index 3d895c7866..59e0c98280 100644 --- a/php/php.editor/test/unit/data/testfiles/index/testPHP82DNFReturnTypes/testPHP82DNFReturnTypes.php.indexed +++ b/php/php.editor/test/unit/data/testfiles/index/testPHP82DNFReturnTypes/testPHP82DNFReturnTypes.php.indexed @@ -3,7 +3,7 @@ Document 0 Searchable Keys: base : arrowfunctiondeclaration:1308;ArrowFunctionDeclaration:1308;1308;;(X&Y)|(Y&Z)|(X&Z);;0;<TESTURL>/testPHP82DNFReturnTypes.php;1;0;(X&Y)|(Y&Z)|(X&Z); - base : lambdafunctiondeclaration:1259;LambdaFunctionDeclaration:1259;1259;$test:int:1::1:0:0:0:0:0;(X&Y&Z)|(X&Z);;0;<TESTURL>/testPHP82DNFReturnTypes.php;1;0;(X&Y&Z)|(X&Z); + base : lambdafunctiondeclaration:1259;LambdaFunctionDeclaration:1259;1259;$test:int:1::1:0:0:0:0:0:int:;(X&Y&Z)|(X&Z);;0;<TESTURL>/testPHP82DNFReturnTypes.php;1;0;(X&Y&Z)|(X&Z); base : returntype;returnType;857;;(\X&\Y)|(\X&\Z);;0;<TESTURL>/testPHP82DNFReturnTypes.php;1;0;(X&Y)|(X&Z); top : $arrow top : $closure diff --git a/php/php.editor/test/unit/data/testfiles/structure/php82/deprecatedDnfParameterTypes_01.php b/php/php.editor/test/unit/data/testfiles/structure/php82/deprecatedDnfParameterTypes_01.php new file mode 100644 index 0000000000..4420b512d2 --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/structure/php82/deprecatedDnfParameterTypes_01.php @@ -0,0 +1,58 @@ +<?php +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +class X {} +class Y {} +class Z {} +/** + * @deprecated + */ +class DeprecatedType {} + +function parameterType((X&Y&DeprecatedType)|(X&Z)|DeprecatedType $param1, (X&Y&DeprecatedType)|DeprecatedType $param2): void { +} + +class TestClass { + public function __construct( + (DeprecatedType&Y)|Z|X $test, + ) {} + + public function parameterType((DeprecatedType&Y)|Z|X $param): int { + return $this->test; + } +} + +trait TestTrait { + public function parameterType((X&Y)|(Y&Z&DeprecatedType) $param): ?string { + return $this->test; + } +} + +interface TestInterface { + public function parameterType(X|(X&Y&Z)|DeprecatedType $param): void; +} + +enum TestEnum { + case Case1; + public function parameterType(int $param1, (X&Y)|DeprecatedType $param2): void {} +} + +$closure = function((X&Y&Z)|(DeprecatedType&Z) $test): void {}; + +$arrow = fn((X&DeprecatedType)|(Y&Z)|(X&Z) $test): (X&DeprecatedType)|(Y&Z)|(X&Z) => $test; diff --git a/php/php.editor/test/unit/data/testfiles/structure/php82/dnfParameterTypes.php b/php/php.editor/test/unit/data/testfiles/structure/php82/dnfParameterTypes.php new file mode 100644 index 0000000000..50f42b64bd --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/structure/php82/dnfParameterTypes.php @@ -0,0 +1,69 @@ +<?php +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +class X {} +class Y {} +class Z {} +class Test {} + +function parameterType((X&Y&Test)|(X&Z) $param): void { +} + +class TestClass { + public function parameterType((Test&Y)|Z|X $param1, bool $param2): (Test&Y)|Z|X { + return $this->test; + } +} + +trait TestTrait { + public function parameterType((X&Y)|(Y&Z&Test) $param): self { + return $this->test; + } +} + +interface TestInterface { + public function parameterType(X|(X&Y&Z)|Z $param); +} + +enum TestEnum { + case Case1; + public function parameterType(X&Y $param1, (X&Y)|Z $param2): (X&Y)|Z {} +} + +$closure = function((X&Y&Z)|(X&Z) $test): (X&Y&Z)|(X&Z) {}; + +$arrow = fn((X&Y)|(Y&Z)|(X&Z) $test): (X&Y)|(Y&Z)|(X&Z) => $test; + +/** + * Magick methods. + * + * @method testVoid((X&Y&Z)|(X&Z) $test) test comment + * @method int testType(X|(X&Y&Z)|Z $test) test comment + * @method (X&Y)|(Y&Z)|(X&Z) dnfType1($param1, (X&Y)|(Y&Z)|Z $param2) test comment + * @method Y|(Y&Z)|X dnfType2($param1, X|(Y&Z)|Z $param2) test comment + * @method static staticTestVoid((Test&Y)|Z|X $test) test comment + * @method static int staticTestType((X&Y)|(Y&Z)|(X&Z) $param1, int $param2) test comment + * @method static (X&Y)|(Y&Z)|(X&Z) staticDnfType1((X&Y)|(Y&Z)|(X&Z) $param1, int $param2) test comment + * @method static X|(Y&Z)|Z staticDnfType2((X&Y)|(Y&Z)|(X&Z) $param1, int $param2) test comment + * @method static X|(Y&Z) staticDnfType3((X&Y)|(Y&Z)|(X&Z) $param1, int $param2) test comment + * @method static ?int staticTestNullable(?string $param, (X&Y)|Y|(X&Z) $param2) test comment + * @method static ?Example getDefault() Description + */ +class MagickMethods { +} diff --git a/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletion201870Test.java b/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletion201870Test.java index 6db5cdb442..62a30d1024 100644 --- a/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletion201870Test.java +++ b/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletion201870Test.java @@ -38,7 +38,10 @@ public class PHPCodeCompletion201870Test extends PHPCodeCompletionTestBase { } public void testUseCase1() throws Exception { - checkCompletion("testfiles/completion/lib/test201870/test201870.php", "$object->get^", false); + // @method tag syntax is `@method [[static] return type] [name]([[type] [parameter]<, ...>]) [<description>]` + // see: https://docs.phpdoc.org/3.0/guide/references/phpdoc/tags/method.html#method + // so, `@method int getBar getBar ($culture = null) Run "bar"` is incorrect syntax + // checkCompletion("testfiles/completion/lib/test201870/test201870.php", "$object->get^", false); } @Override diff --git a/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletion203294Test.java b/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletion203294Test.java index 19a70d513d..7af9a3b793 100644 --- a/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletion203294Test.java +++ b/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletion203294Test.java @@ -38,7 +38,10 @@ public class PHPCodeCompletion203294Test extends PHPCodeCompletionTestBase { } public void testUseCase1() throws Exception { - checkCompletion("testfiles/completion/lib/test203294/test203294.php", "$f->^", false); + // @method tag syntax is `@method [[static] return type] [name]([[type] [parameter]<, ...>]) [<description>]` + // see: https://docs.phpdoc.org/3.0/guide/references/phpdoc/tags/method.html#method + // so, `@method int i() i($a = array()) Comment 10` is incorrect + // checkCompletion("testfiles/completion/lib/test203294/test203294.php", "$f->^", false); } @Override diff --git a/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/csl/NavigatorDeprecatedTest.java b/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/csl/NavigatorDeprecatedTest.java index bcae5f7978..165646673b 100644 --- a/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/csl/NavigatorDeprecatedTest.java +++ b/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/csl/NavigatorDeprecatedTest.java @@ -66,6 +66,10 @@ public class NavigatorDeprecatedTest extends PhpNavigatorTestBase { performTest("structure/php82/deprecatedDnfReturnTypes_01"); } + public void testDeprecatedTypesForDNFParameterTypes_01() throws Exception { + performTest("structure/php82/deprecatedDnfParameterTypes_01"); + } + @Override protected Map<String, ClassPath> createClassPathsForTest() { return Collections.singletonMap( diff --git a/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/csl/NavigatorTest.java b/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/csl/NavigatorTest.java index f76858029c..0504b8053b 100644 --- a/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/csl/NavigatorTest.java +++ b/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/csl/NavigatorTest.java @@ -136,4 +136,8 @@ public class NavigatorTest extends PhpNavigatorTestBase { performTest("structure/php82/dnfReturnTypes"); } + public void testDNFParameterTypes() throws Exception { + performTest("structure/php82/dnfParameterTypes"); + } + } diff --git a/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/index/PHPIndexTest.java b/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/index/PHPIndexTest.java index 7d0661e800..82eec079d4 100644 --- a/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/index/PHPIndexTest.java +++ b/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/index/PHPIndexTest.java @@ -768,6 +768,10 @@ public class PHPIndexTest extends PHPNavTestBase { checkIndexer(getTestPath()); } + public void testPHP82DNFParameterTypes() throws Exception { + checkIndexer(getTestPath()); + } + @Override protected FileObject[] createSourceClassPathsForTest() { final File folder = new File(getDataDir(), getTestFolderPath()); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists