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 a32131e6ae856fa87b0861572d05e9ffbffcb07d Author: Junichi Yamamoto <junich...@apache.org> AuthorDate: Fri Apr 28 11:01:36 2023 +0900 PHP 8.2 Support: Disjunctive Normal Form Types (Part 2) - https://github.com/apache/netbeans/issues/4725 - https://wiki.php.net/rfc/dnf_types - Fix DNF return types for the navigator --- .../org/netbeans/modules/php/editor/CodeUtils.java | 90 ++++++++++---- .../modules/php/editor/api/QualifiedName.java | 10 +- .../php/editor/api/elements/AliasedFunction.java | 5 + .../editor/api/elements/BaseFunctionElement.java | 6 + .../modules/php/editor/csl/NavigatorScanner.java | 41 ++++++- .../elements/BaseFunctionElementSupport.java | 25 +++- .../php/editor/elements/FunctionElementImpl.java | 20 +++ .../php/editor/elements/MethodElementImpl.java | 42 +++++-- .../modules/php/editor/index/PHPIndexer.java | 2 +- .../modules/php/editor/model/FunctionScope.java | 1 + .../php/editor/model/impl/FunctionScopeImpl.java | 87 +++++++------ .../php/editor/model/impl/MethodScopeImpl.java | 7 ++ .../deprecatedTypesForNullableTypes_02.pass | 2 +- .../php82/deprecatedDnfReturnTypes_01.pass | 14 +++ .../NavigatorTest/structure/nullableTypes_02.pass | 2 +- .../structure/php82/dnfReturnTypes.pass | 14 +++ .../structure/pureIntersectionTypes.pass | 10 +- .../index/testGetEnums/testGetEnums.php.indexed | 8 +- .../testGetFunctions/testGetFunctions.php.indexed | 6 +- .../testGetMethods/testGetMethods.php.indexed | 2 +- .../testIssue240824/testIssue240824.php.indexed | 2 +- .../testNullableTypesForFunctions.php.indexed | 4 +- .../testNullableTypesForMethods.php.indexed | 8 +- ...stPHP80ConstructorPropertyPromotion.php.indexed | 20 +-- .../testPHP80MixedReturnType.php.indexed | 4 +- .../testPHP80UnionTypesFunctions.php.indexed | 12 +- .../testPHP80UnionTypesTypes.php.indexed | 16 +-- .../testPHP81PureIntersectionTypes.php.indexed | 24 ++-- .../testPHP82ConstantsInTraits.php.indexed | 2 +- .../testPHP82DNFReturnTypes.php} | 37 ++---- .../testPHP82DNFReturnTypes.php.indexed | 136 +++++++++++++++++++++ .../deprecatedDnfReturnTypes_01.php} | 43 +++---- .../dnfReturnTypes.php} | 40 ++---- .../testfiles/structure/pureIntersectionTypes.php | 2 +- .../php/editor/csl/NavigatorDeprecatedTest.java | 4 + .../modules/php/editor/csl/NavigatorTest.java | 4 + .../modules/php/editor/index/PHPIndexTest.java | 4 + 37 files changed, 530 insertions(+), 226 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 d87712a333..e18311e208 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 @@ -254,15 +254,9 @@ public final class CodeUtils { } else if (typeName instanceof NullableType) { return NULLABLE_TYPE_PREFIX + extractUnqualifiedName(((NullableType) typeName).getType()); } else if (typeName instanceof UnionType) { - UnionType unionType = (UnionType) typeName; - StringBuilder sb = new StringBuilder(); - for (Expression type : unionType.getTypes()) { - if (sb.length() > 0) { - sb.append(Type.SEPARATOR); - } - sb.append(extractUnqualifiedName(type)); - } - return sb.toString(); + return extractUnqualifiedName((UnionType) typeName); + } else if (typeName instanceof IntersectionType) { + return extractUnqualifiedName((IntersectionType) typeName); } //TODO: php5.3 !!! @@ -270,6 +264,35 @@ public final class CodeUtils { return null; } + private static String extractUnqualifiedName(UnionType unionType) { + StringBuilder sb = new StringBuilder(); + for (Expression type : unionType.getTypes()) { + if (sb.length() > 0) { + sb.append(Type.SEPARATOR); + } + boolean isIntersectionType = type instanceof IntersectionType; + if (isIntersectionType) { + sb.append("("); // NOI18N + } + sb.append(extractUnqualifiedName(type)); + if (isIntersectionType) { + sb.append(")"); // NOI18N + } + } + return sb.toString(); + } + + private static String extractUnqualifiedName(IntersectionType intersectionType) { + StringBuilder sb = new StringBuilder(); + for (Expression type : intersectionType.getTypes()) { + if (sb.length() > 0) { + sb.append(Type.SEPARATOR_INTERSECTION); + } + sb.append(extractUnqualifiedName(type)); + } + return sb.toString(); + } + /** * Extract qualified name for Identifier, NamespaceName, NullableType, and * UnionType. @@ -292,30 +315,43 @@ public final class CodeUtils { } else if (typeName instanceof ExpressionArrayAccess) { return extractQualifiedName(((ExpressionArrayAccess) typeName).getExpression()); } else if (typeName instanceof UnionType) { - UnionType unionType = (UnionType) typeName; - StringBuilder sb = new StringBuilder(); - for (Expression type : unionType.getTypes()) { - if (sb.length() > 0) { - sb.append(Type.SEPARATOR); - } - sb.append(extractQualifiedName(type)); - } - return sb.toString(); + return extractQualifiedName((UnionType) typeName); } else if (typeName instanceof IntersectionType) { - IntersectionType intersectionType = (IntersectionType) typeName; - StringBuilder sb = new StringBuilder(); - for (Expression type : intersectionType.getTypes()) { - if (sb.length() > 0) { - sb.append(Type.SEPARATOR_INTERSECTION); - } - sb.append(extractQualifiedName(type)); - } - return sb.toString(); + return extractQualifiedName((IntersectionType) typeName); } assert false : typeName.getClass(); return null; } + private static String extractQualifiedName(UnionType unionType) { + StringBuilder sb = new StringBuilder(); + for (Expression type : unionType.getTypes()) { + if (sb.length() > 0) { + sb.append(Type.SEPARATOR); + } + boolean isIntersectionType = type instanceof IntersectionType; + if (isIntersectionType) { + sb.append("("); // NOI18N + } + sb.append(extractQualifiedName(type)); + if (isIntersectionType) { + sb.append(")"); // NOI18N + } + } + return sb.toString(); + } + + private static String extractQualifiedName(IntersectionType intersectionType) { + StringBuilder sb = new StringBuilder(); + for (Expression type : intersectionType.getTypes()) { + if (sb.length() > 0) { + sb.append(Type.SEPARATOR_INTERSECTION); + } + sb.append(extractQualifiedName(type)); + } + return sb.toString(); + } + // XXX not only class name anymore in php7+ public static String extractUnqualifiedClassName(StaticDispatch dispatch) { Parameters.notNull("dispatch", dispatch); diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/api/QualifiedName.java b/php/php.editor/src/org/netbeans/modules/php/editor/api/QualifiedName.java index 5ac211da80..0296bc08a6 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/api/QualifiedName.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/api/QualifiedName.java @@ -147,9 +147,13 @@ public final class QualifiedName { public static List<QualifiedName> create(UnionType unionType) { List<QualifiedName> qualifiedNames = new ArrayList<>(); for (Expression type : unionType.getTypes()) { - QualifiedName qualifiedName = create(type); - if (qualifiedName != null) { - qualifiedNames.add(qualifiedName); + if (type instanceof IntersectionType) { + qualifiedNames.addAll(create((IntersectionType) type)); + } else { + QualifiedName qualifiedName = create(type); + if (qualifiedName != null) { + qualifiedNames.add(qualifiedName); + } } } return qualifiedNames; diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/api/elements/AliasedFunction.java b/php/php.editor/src/org/netbeans/modules/php/editor/api/elements/AliasedFunction.java index 015c574ba3..db06ececeb 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/api/elements/AliasedFunction.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/api/elements/AliasedFunction.java @@ -48,6 +48,11 @@ public class AliasedFunction extends AliasedElement implements FunctionElement { return getRealFunction().getReturnTypes(); } + @Override + public String getDeclaredReturnType() { + return getRealFunction().getDeclaredReturnType(); + } + @Override public boolean isReturnUnionType() { return getRealFunction().isReturnUnionType(); diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/api/elements/BaseFunctionElement.java b/php/php.editor/src/org/netbeans/modules/php/editor/api/elements/BaseFunctionElement.java index 0d262a7706..65d692e19c 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/api/elements/BaseFunctionElement.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/api/elements/BaseFunctionElement.java @@ -41,6 +41,12 @@ public interface BaseFunctionElement extends PhpElement { List<ParameterElement> getParameters(); Collection<TypeResolver> getReturnTypes(); + /** + * Get the declared return type in the declaration. + * + * @return declared return type + */ + String getDeclaredReturnType(); /** * Check whether return type is a union type. * 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 2d36ab4357..d9fddf9367 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 @@ -34,6 +34,7 @@ import org.netbeans.modules.csl.api.HtmlFormatter; import org.netbeans.modules.csl.api.Modifier; import org.netbeans.modules.csl.api.OffsetRange; import org.netbeans.modules.csl.api.StructureItem; +import org.netbeans.modules.php.api.util.StringUtils; import org.netbeans.modules.php.editor.CodeUtils; import org.netbeans.modules.php.editor.api.AliasedName; import org.netbeans.modules.php.editor.api.NameKind; @@ -419,7 +420,10 @@ public final class NavigatorScanner { formatter.appendHtml(CLOSE_FONT); } Collection<? extends String> returnTypes = function.getReturnTypeNames(); - if (!returnTypes.isEmpty()) { + String declaredReturnType = function.getDeclaredReturnType(); + if (StringUtils.hasText(declaredReturnType)) { + processReturnTypes(function, formatter, declaredReturnType); + } else if (!returnTypes.isEmpty()) { processReturnTypes(function, formatter, returnTypes); } } @@ -481,6 +485,41 @@ 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); + switch (c) { + case '(': // no break + case '?': + formatter.appendText(String.valueOf(c)); + break; + case ')': // no break + case '|': // no break + case '&': + processTypeName(sb, function, formatter); + formatter.appendText(String.valueOf(c)); + break; + default: + sb.append(c); + break; + } + } + if (sb.length() > 0) { + processTypeName(sb, function, formatter); + } + formatter.appendHtml(CLOSE_FONT); + } + } + + private void processTypeName(StringBuilder sb, FunctionScope function, HtmlFormatter formatter) { + String type = sb.toString(); + if (sb.length() > 0) { + sb.delete(0, sb.length()); + processTypeName(type, function, formatter); + } } private void processTypeName(String type, ModelElement element, HtmlFormatter formatter) { diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/elements/BaseFunctionElementSupport.java b/php/php.editor/src/org/netbeans/modules/php/editor/elements/BaseFunctionElementSupport.java index fd1db12a4f..b9ef007a92 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/elements/BaseFunctionElementSupport.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/elements/BaseFunctionElementSupport.java @@ -23,6 +23,7 @@ import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Set; +import org.netbeans.api.annotations.common.CheckForNull; import org.netbeans.api.annotations.common.NullAllowed; import org.netbeans.modules.php.api.PhpVersion; import org.netbeans.modules.php.api.util.StringUtils; @@ -39,6 +40,7 @@ import org.netbeans.modules.php.editor.api.elements.TypeNameResolver; import org.netbeans.modules.php.editor.api.elements.TypeResolver; import org.netbeans.modules.php.editor.model.impl.Type; import org.netbeans.modules.php.editor.parser.astnodes.ASTNode; +import org.netbeans.modules.php.editor.parser.astnodes.Expression; import org.netbeans.modules.php.editor.parser.astnodes.IntersectionType; import org.netbeans.modules.php.editor.parser.astnodes.UnionType; @@ -64,6 +66,10 @@ public class BaseFunctionElementSupport { return returnTypes.getReturnTypes(); } + public final String getDeclaredReturnType() { + return returnTypes.getDeclaredReturnType(); + } + public final boolean isReturnUnionType() { return returnTypes.isUnionType(); } @@ -337,11 +343,18 @@ public class BaseFunctionElementSupport { public boolean isIntersectionType() { return false; } + + @Override + public String getDeclaredReturnType() { + return null; + } }; Set<TypeResolver> getReturnTypes(); boolean isUnionType(); boolean isIntersectionType(); + @CheckForNull + String getDeclaredReturnType(); } public static final class ReturnTypesImpl implements ReturnTypes { @@ -349,15 +362,18 @@ public class BaseFunctionElementSupport { private final Set<TypeResolver> returnTypes; private final boolean isUnionType; private final boolean isIntersectionType; + @NullAllowed + private final String declaredReturnType; - public static ReturnTypes create(Set<TypeResolver> returnTypes, ASTNode node) { + public static ReturnTypes create(Set<TypeResolver> returnTypes, Expression node) { return new ReturnTypesImpl(returnTypes, node); } - private ReturnTypesImpl(Set<TypeResolver> returnTypes, ASTNode node) { + private ReturnTypesImpl(Set<TypeResolver> returnTypes, Expression node) { this.returnTypes = returnTypes; this.isUnionType = node instanceof UnionType; this.isIntersectionType = node instanceof IntersectionType; + this.declaredReturnType = CodeUtils.extractQualifiedName(node); } @Override @@ -365,6 +381,11 @@ public class BaseFunctionElementSupport { return Collections.unmodifiableSet(returnTypes); } + @Override + public String getDeclaredReturnType() { + return declaredReturnType; + } + @Override public boolean isUnionType() { return isUnionType; diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/elements/FunctionElementImpl.java b/php/php.editor/src/org/netbeans/modules/php/editor/elements/FunctionElementImpl.java index 417b6abaee..03320a9a12 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/elements/FunctionElementImpl.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/elements/FunctionElementImpl.java @@ -23,6 +23,7 @@ import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; +import org.netbeans.api.annotations.common.NullAllowed; import org.netbeans.modules.parsing.spi.indexing.support.IndexResult; import org.netbeans.modules.php.api.PhpVersion; import org.netbeans.modules.php.editor.CodeUtils; @@ -149,6 +150,7 @@ public final class FunctionElementImpl extends FullyQualifiedElementImpl impleme sb.append(getFilenameUrl()).append(Separator.SEMICOLON); sb.append(isReturnUnionType() ? 1 : 0).append(Separator.SEMICOLON); sb.append(isReturnIntersectionType() ? 1 : 0).append(Separator.SEMICOLON); + sb.append(getDeclaredReturnType()).append(Separator.SEMICOLON); return sb.toString(); } @@ -163,6 +165,7 @@ public final class FunctionElementImpl extends FullyQualifiedElementImpl impleme assert getOffset() == parser.getOffset(); assert getParameters().size() == parser.getParameters().size(); assert getReturnTypes().size() == parser.getReturnTypes().size(); + assert getDeclaredReturnType().equals(parser.getDeclaredReturnType()); } } @@ -176,6 +179,11 @@ public final class FunctionElementImpl extends FullyQualifiedElementImpl impleme return this.functionSupport.getReturnTypes(); } + @Override + public String getDeclaredReturnType() { + return this.functionSupport.getDeclaredReturnType(); + } + @Override public boolean isReturnUnionType() { return this.functionSupport.isReturnUnionType(); @@ -247,6 +255,10 @@ public final class FunctionElementImpl extends FullyQualifiedElementImpl impleme boolean isReturnIntersectionType() { return signature.integer(9) == 1; } + + String getDeclaredReturnType() { + return signature.string(10); + } } private static final class ParametersFromSignature implements BaseFunctionElementSupport.Parameters { @@ -273,11 +285,14 @@ public final class FunctionElementImpl extends FullyQualifiedElementImpl impleme private Set<TypeResolver> retrievedReturnTypes = null; private final boolean isUnionType; private final boolean isIntersectionType; + @NullAllowed + private final String declaredReturnType; public ReturnTypesFromSignature(FunctionSignatureParser functionSignatureParser) { this.functionSignatureParser = functionSignatureParser; this.isUnionType = functionSignatureParser.isReturnUnionType(); this.isIntersectionType = functionSignatureParser.isReturnIntersectionType(); + this.declaredReturnType = functionSignatureParser.getDeclaredReturnType(); } @Override @@ -298,5 +313,10 @@ public final class FunctionElementImpl extends FullyQualifiedElementImpl impleme return isIntersectionType; } + @Override + public String getDeclaredReturnType() { + return declaredReturnType; + } + } } 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 7f31b0873d..98823fc0c4 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 @@ -23,7 +23,10 @@ import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.List; +import java.util.Locale; import java.util.Set; +import org.netbeans.api.annotations.common.CheckForNull; +import org.netbeans.api.annotations.common.NullAllowed; import org.netbeans.modules.parsing.spi.indexing.support.IndexResult; import org.netbeans.modules.php.api.PhpVersion; import org.netbeans.modules.php.editor.api.ElementQuery; @@ -208,6 +211,11 @@ public final class MethodElementImpl extends PhpElementImpl implements MethodEle return this.functionSupport.getReturnTypes(); } + @Override + public String getDeclaredReturnType() { + return functionSupport.getDeclaredReturnType(); + } + @Override public boolean isReturnUnionType() { return functionSupport.isReturnUnionType(); @@ -259,8 +267,8 @@ public final class MethodElementImpl extends PhpElementImpl implements MethodEle @Override public String getSignature() { StringBuilder sb = new StringBuilder(); - sb.append(getName().toLowerCase()).append(Separator.SEMICOLON); //NOI18N - sb.append(getName()).append(Separator.SEMICOLON); //NOI18N + sb.append(getName().toLowerCase(Locale.ROOT)).append(Separator.SEMICOLON); // 0: lower case name + sb.append(getName()).append(Separator.SEMICOLON); // 1: name sb.append(getSignatureLastPart()); checkSignature(sb); return sb.toString(); @@ -277,26 +285,27 @@ public final class MethodElementImpl extends PhpElementImpl implements MethodEle private String getSignatureLastPart() { StringBuilder sb = new StringBuilder(); - sb.append(getOffset()).append(Separator.SEMICOLON); + sb.append(getOffset()).append(Separator.SEMICOLON); // 2: offset List<ParameterElement> parameterList = getParameters(); for (int idx = 0; idx < parameterList.size(); idx++) { ParameterElementImpl parameter = (ParameterElementImpl) parameterList.get(idx); if (idx > 0) { sb.append(Separator.COMMA); } - sb.append(parameter.getSignature()); + sb.append(parameter.getSignature()); // 3: parameter } sb.append(Separator.SEMICOLON); for (TypeResolver typeResolver : getReturnTypes()) { TypeResolverImpl resolverImpl = (TypeResolverImpl) typeResolver; - sb.append(resolverImpl.getSignature()); + sb.append(resolverImpl.getSignature()); // 4: return types } sb.append(Separator.SEMICOLON); - sb.append(getPhpModifiers().toFlags()).append(Separator.SEMICOLON); - sb.append(isDeprecated() ? 1 : 0).append(Separator.SEMICOLON); - sb.append(getFilenameUrl()).append(Separator.SEMICOLON); - sb.append(isReturnUnionType()? 1 : 0).append(Separator.SEMICOLON); - sb.append(isReturnIntersectionType() ? 1 : 0).append(Separator.SEMICOLON); + sb.append(getPhpModifiers().toFlags()).append(Separator.SEMICOLON); // 5: flags + sb.append(isDeprecated() ? 1 : 0).append(Separator.SEMICOLON); // 6: isDeprecated + sb.append(getFilenameUrl()).append(Separator.SEMICOLON); // 7: file name URL + sb.append(isReturnUnionType()? 1 : 0).append(Separator.SEMICOLON); // 8: isReturnUnionType + sb.append(isReturnIntersectionType() ? 1 : 0).append(Separator.SEMICOLON); // 9: isReturnIntersectionType + sb.append(getDeclaredReturnType()).append(Separator.SEMICOLON); // 10: declared return type return sb.toString(); } @@ -378,6 +387,10 @@ public final class MethodElementImpl extends PhpElementImpl implements MethodEle boolean isIntersectionType() { return signature.integer(9) == 1; } + + String getDeclaredReturnType() { + return signature.string(10); + } } private void checkSignature(StringBuilder sb) { @@ -391,6 +404,7 @@ public final class MethodElementImpl extends PhpElementImpl implements MethodEle assert getPhpModifiers().toFlags() == parser.getFlags(); assert getParameters().size() == parser.getParameters().size(); assert getReturnTypes().size() == parser.getReturnTypes().size(); + assert getDeclaredReturnType().equals(parser.getDeclaredReturnType()); } } @@ -431,11 +445,14 @@ public final class MethodElementImpl extends PhpElementImpl implements MethodEle private Set<TypeResolver> retrievedReturnTypes = null; private final boolean isUnionType; private final boolean isIntersectionType; + @NullAllowed + private final String declaredReturnType; public ReturnTypesFromSignature(MethodSignatureParser methodSignatureParser) { this.methodSignatureParser = methodSignatureParser; this.isUnionType = methodSignatureParser.isUnionType(); this.isIntersectionType = methodSignatureParser.isIntersectionType(); + this.declaredReturnType = methodSignatureParser.getDeclaredReturnType(); } @Override @@ -456,5 +473,10 @@ public final class MethodElementImpl extends PhpElementImpl implements MethodEle return isIntersectionType; } + @CheckForNull + @Override + public String getDeclaredReturnType() { + return declaredReturnType; + } } } 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 21dbf20d68..0a25de5f3d 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 = 34; + public static final int VERSION = 35; @Override public EmbeddingIndexer createIndexer(final Indexable indexable, final Snapshot snapshot) { diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/FunctionScope.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/FunctionScope.java index cb506ca509..0a2a463e90 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/model/FunctionScope.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/FunctionScope.java @@ -35,6 +35,7 @@ public interface FunctionScope extends Scope, VariableScope, FullyQualifiedEleme Collection<? extends String> getReturnTypeNames(); Collection<? extends TypeScope> getReturnTypes(); Collection<? extends TypeScope> getReturnTypes(boolean resolve, Collection<? extends TypeScope> callerTypes); + String getDeclaredReturnType(); boolean isReturnUnionType(); boolean isReturnIntersectionType(); 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 2bf3f465e1..e03300702e 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 @@ -30,7 +30,9 @@ import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.text.BadLocationException; +import org.netbeans.api.annotations.common.CheckForNull; import org.netbeans.api.annotations.common.NonNull; +import org.netbeans.api.annotations.common.NullAllowed; import org.netbeans.editor.BaseDocument; import org.netbeans.modules.csl.spi.GsfUtilities; import org.netbeans.modules.parsing.spi.indexing.support.IndexDocument; @@ -81,9 +83,12 @@ class FunctionScopeImpl extends ScopeImpl implements FunctionScope, VariableName private static final String TYPE_SEPARATOR_REGEXP = "\\|"; //NOI18N private static final String TYPE_SEPARATOR_INTERSECTION_REGEXP = "\\&"; //NOI18N private List<? extends ParameterElement> paremeters; - private final boolean declaredReturnType; + private final boolean hasDeclaredReturnType; //@GuardedBy("this") + @NullAllowed private String returnType; + @NullAllowed + private final String declaredReturnType; private final boolean isReturnUnionType; private final boolean isReturnIntersectionType; @@ -92,7 +97,8 @@ class FunctionScopeImpl extends ScopeImpl implements FunctionScope, VariableName super(inScope, info, PhpModifiers.fromBitMask(PhpModifiers.PUBLIC), info.getOriginalNode().getBody(), isDeprecated); this.paremeters = info.getParameters(); this.returnType = returnType; - declaredReturnType = !info.getReturnTypes().isEmpty(); + hasDeclaredReturnType = !info.getReturnTypes().isEmpty(); + this.declaredReturnType = hasDeclaredReturnType ? CodeUtils.extractQualifiedName(info.getOriginalNode().getReturnType()) : null; isReturnUnionType = info.getOriginalNode().getReturnType() instanceof UnionType; isReturnIntersectionType = info.getOriginalNode().getReturnType() instanceof IntersectionType; } @@ -102,11 +108,14 @@ class FunctionScopeImpl extends ScopeImpl implements FunctionScope, VariableName this.paremeters = info.getParameters(); isReturnUnionType = info.getOriginalNode().getReturnType() instanceof UnionType; isReturnIntersectionType = info.getOriginalNode().getReturnType() instanceof IntersectionType; - List<QualifiedName> retTypes = info.getReturnTypes(); - if (!retTypes.isEmpty()) { - this.returnType = isReturnIntersectionType ? asIntersectionType(retTypes) : asUnionType(retTypes); - } - declaredReturnType = !retTypes.isEmpty(); + this.hasDeclaredReturnType = info.getOriginalNode().getReturnType() != null; + if (this.hasDeclaredReturnType) { + this.returnType = CodeUtils.extractQualifiedName(info.getOriginalNode().getReturnType()); + this.declaredReturnType = returnType; + } else { + this.returnType = null; + this.declaredReturnType = null; + } } FunctionScopeImpl(Scope inScope, ArrowFunctionDeclarationInfo info, Block block) { @@ -114,18 +123,22 @@ class FunctionScopeImpl extends ScopeImpl implements FunctionScope, VariableName this.paremeters = info.getParameters(); isReturnUnionType = info.getOriginalNode().getReturnType() instanceof UnionType; isReturnIntersectionType = info.getOriginalNode().getReturnType() instanceof IntersectionType; - List<QualifiedName> retTypes = info.getReturnTypes(); - if (!retTypes.isEmpty()) { - this.returnType = isReturnIntersectionType ? asIntersectionType(retTypes) : asUnionType(retTypes); + this.hasDeclaredReturnType = info.getOriginalNode().getReturnType() != null; + if (this.hasDeclaredReturnType) { + this.returnType = CodeUtils.extractQualifiedName(info.getOriginalNode().getReturnType()); + this.declaredReturnType = returnType; + } else { + this.returnType = null; + this.declaredReturnType = null; } - declaredReturnType = !retTypes.isEmpty(); } protected FunctionScopeImpl(Scope inScope, MethodDeclarationInfo info, String returnType, boolean isDeprecated) { super(inScope, info, info.getAccessModifiers(), info.getOriginalNode().getFunction().getBody(), isDeprecated); this.paremeters = info.getParameters(); this.returnType = returnType; - declaredReturnType = info.getOriginalNode().getFunction().getReturnType() != null; + hasDeclaredReturnType = info.getOriginalNode().getFunction().getReturnType() != null; + this.declaredReturnType = hasDeclaredReturnType ? CodeUtils.extractQualifiedName(info.getOriginalNode().getFunction().getReturnType()) : null; isReturnUnionType = info.getOriginalNode().getFunction().getReturnType() instanceof UnionType; isReturnIntersectionType = info.getOriginalNode().getFunction().getReturnType() instanceof IntersectionType; } @@ -134,7 +147,8 @@ class FunctionScopeImpl extends ScopeImpl implements FunctionScope, VariableName super(inScope, info, info.getAccessModifiers(), null, isDeprecated); this.paremeters = info.getParameters(); this.returnType = returnType; - declaredReturnType = false; + this.declaredReturnType = null; + hasDeclaredReturnType = false; isReturnUnionType = false; isReturnIntersectionType = false; } @@ -147,8 +161,8 @@ class FunctionScopeImpl extends ScopeImpl implements FunctionScope, VariableName super(inScope, element, kind); this.paremeters = element.getParameters(); this.returnType = element.asString(PrintAs.ReturnSemiTypes); - // XXX ??? - declaredReturnType = false; + this.declaredReturnType = element.getDeclaredReturnType(); + this.hasDeclaredReturnType = StringUtils.hasText(declaredReturnType); isReturnUnionType = element.isReturnUnionType(); isReturnIntersectionType = element.isReturnIntersectionType(); } @@ -211,7 +225,7 @@ class FunctionScopeImpl extends ScopeImpl implements FunctionScope, VariableName * @param type return type to be added */ public void addReturnType(String type) { - if (declaredReturnType) { + if (hasDeclaredReturnType) { return; } synchronized (this) { @@ -230,6 +244,12 @@ class FunctionScopeImpl extends ScopeImpl implements FunctionScope, VariableName return returnType; } + @CheckForNull + @Override + public String getDeclaredReturnType() { + return declaredReturnType; + } + @Override public Collection<? extends TypeScope> getReturnTypes() { return getReturnTypesDescriptor(getReturnType(), false).getModifiedResult(Collections.<TypeScope>emptyList()); @@ -273,7 +293,7 @@ class FunctionScopeImpl extends ScopeImpl implements FunctionScope, VariableName cTypes.addAll(callerTypes); } Collection<? extends TypeScope> result = getReturnTypesDescriptor(types, resolveSemiTypes, cTypes).getModifiedResult(cTypes); - if (!declaredReturnType) { + if (!hasDeclaredReturnType) { updateReturnTypes(types, result); } return result; @@ -396,18 +416,6 @@ class FunctionScopeImpl extends ScopeImpl implements FunctionScope, VariableName return result; } - private String asUnionType(List<QualifiedName> qualifiedNames) { - List<String> types = new ArrayList<>(); - qualifiedNames.forEach(type -> types.add(type.toString())); - return Type.asUnionType(types); - } - - private String asIntersectionType(List<QualifiedName> qualifiedNames) { - List<String> types = new ArrayList<>(); - qualifiedNames.forEach(type -> types.add(type.toString())); - return Type.asIntersectionType(types); - } - @org.netbeans.api.annotations.common.SuppressWarnings("SE_COMPARATOR_SHOULD_BE_SERIALIZABLE") private static final class ModelElementsPositionComparator implements Comparator<ModelElement> { @@ -499,17 +507,21 @@ class FunctionScopeImpl extends ScopeImpl implements FunctionScope, VariableName sb.append(param); } sb.append(')'); // NOI18N - Collection<? extends TypeScope> returnTypes = getReturnTypes(); sb.append(':'); // NOI18N boolean first = true; - for (TypeScope typeScope : returnTypes) { - if (first) { - first = false; - sb.append(' '); // NOI18N - } else { - sb.append(Type.getTypeSeparator(isReturnIntersectionType)); + if (hasDeclaredReturnType) { + sb.append(' ').append(getDeclaredReturnType()); + } else { + Collection<? extends TypeScope> returnTypes = getReturnTypes(); + for (TypeScope typeScope : returnTypes) { + if (first) { + first = false; + sb.append(' '); // NOI18N + } else { + sb.append(Type.getTypeSeparator(isReturnIntersectionType)); + } + sb.append(typeScope.getName()); } - sb.append(typeScope.getName()); } return sb.toString(); } @@ -565,6 +577,7 @@ class FunctionScopeImpl extends ScopeImpl implements FunctionScope, VariableName sb.append(getFilenameUrl()).append(Signature.ITEM_DELIMITER); sb.append(isReturnUnionType() ? 1 : 0).append(Signature.ITEM_DELIMITER); sb.append(isReturnIntersectionType()? 1 : 0).append(Signature.ITEM_DELIMITER); + sb.append((getDeclaredReturnType() != null) ? getDeclaredReturnType() : "").append(Signature.ITEM_DELIMITER); // NOI18N return sb.toString(); } diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/MethodScopeImpl.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/MethodScopeImpl.java index ee642fabee..5d11f5cbe2 100644 --- a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/MethodScopeImpl.java +++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/MethodScopeImpl.java @@ -116,6 +116,12 @@ final class MethodScopeImpl extends FunctionScopeImpl implements MethodScope, Va return super.getDeclaredVariables(); } + @Override + public String getDeclaredReturnType() { + scan(); + return super.getDeclaredReturnType(); + } + @Override public Collection<? extends TypeScope> getReturnTypes() { scan(); @@ -284,6 +290,7 @@ final class MethodScopeImpl extends FunctionScopeImpl implements MethodScope, Va sb.append(getFilenameUrl()).append(Signature.ITEM_DELIMITER); sb.append(isReturnUnionType() ? 1 : 0).append(Signature.ITEM_DELIMITER); sb.append(isReturnIntersectionType() ? 1 : 0).append(Signature.ITEM_DELIMITER); + sb.append((getDeclaredReturnType() != null) ? getDeclaredReturnType() : "").append(Signature.ITEM_DELIMITER); // NOI18N return sb.toString(); } 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 1742a84573..ae28f947bc 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{, }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/deprecatedDnfReturnTypes_01.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorDeprecatedTest/structure/php82/deprecatedDnfReturnTypes_01.pass new file mode 100644 index 0000000000..e066d83603 --- /dev/null +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorDeprecatedTest/structure/php82/deprecatedDnfReturnTypes_01.pass @@ -0,0 +1,14 @@ +|-X [820, 824] : ESCAPED{X} +|-Y [831, 835] : ESCAPED{Y} +|-Z [842, 846] : ESCAPED{Z} +|-DeprecatedType [876, 893] : DEPRECATED{ESCAPED{DeprecatedType}} +|-returnType [904, 963] : ESCAPED{returnType}ESCAPED{(}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}}</font> +|-TestClass [971, 1077] : ESCAPED{TestClass} +|--returnType [1003, 1075] : ESCAPED{returnType}ESCAPED{(}ESCAPED{)}<font color="#999999">:ESCAPED{(}DEPRECATED{ESCAPED{DeprecatedType}}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}ESCAPED{Z}ESCAPED{|}ESCAPED{X}</font> +|-TestTrait [1085, 1195] : ESCAPED{TestTrait} +|--returnType [1117, 1193] : ESCAPED{returnType}ESCAPED{(}ESCAPED{)}<font color="#999999">:ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}ESCAPED{(}ESCAPED{Y}ESCAPED{&}ESCAPED{Z}ESCAPED{&}DEPRECATED{ESCAPED{DeprecatedType}}ESCAPED{)}</font> +|-TestInterface [1207, 1284] : ESCAPED{TestInterface} +|--returnType [1243, 1282] : ESCAPED{returnType}ESCAPED{(}ESCAPED{)}<font color="#999999">:ESCAPED{X}ESCAPED{|}ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{&}ESCAPED{Z}ESCAPED{)}ESCAPED{|}DEPRECATED{ESCAPED{DeprecatedType}}</font> +|-TestEnum [1291, 1377] : ESCAPED{TestEnum} +|--Case1 [1311, 1316] : ESCAPED{Case1} +|--returnType [1338, 1375] : ESCAPED{returnType}ESCAPED{(}ESCAPED{)}<font color="#999999">:ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}DEPRECATED{ESCAPED{DeprecatedType}}</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 62e97a5f39..93533b9e5a 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{, }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/dnfReturnTypes.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/php82/dnfReturnTypes.pass new file mode 100644 index 0000000000..72caed68e2 --- /dev/null +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/php82/dnfReturnTypes.pass @@ -0,0 +1,14 @@ +|-X [820, 824] : ESCAPED{X} +|-Y [831, 835] : ESCAPED{Y} +|-Z [842, 846] : ESCAPED{Z} +|-Test [853, 860] : ESCAPED{Test} +|-returnType [871, 905] : ESCAPED{returnType}ESCAPED{(}ESCAPED{)}<font color="#999999">:ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{&}ESCAPED{Test}ESCAPED{)}ESCAPED{|}ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Z}ESCAPED{)}</font> +|-TestClass [913, 1009] : ESCAPED{TestClass} +|--returnType [945, 1007] : ESCAPED{returnType}ESCAPED{(}ESCAPED{)}<font color="#999999">:ESCAPED{(}ESCAPED{Test}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}ESCAPED{Z}ESCAPED{|}ESCAPED{X}</font> +|-TestTrait [1017, 1117] : ESCAPED{TestTrait} +|--returnType [1049, 1115] : ESCAPED{returnType}ESCAPED{(}ESCAPED{)}<font color="#999999">:ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}ESCAPED{(}ESCAPED{Y}ESCAPED{&}ESCAPED{Z}ESCAPED{&}ESCAPED{Test}ESCAPED{)}</font> +|-TestInterface [1129, 1193] : ESCAPED{TestInterface} +|--returnType [1165, 1191] : ESCAPED{returnType}ESCAPED{(}ESCAPED{)}<font color="#999999">:ESCAPED{X}ESCAPED{|}ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{&}ESCAPED{Z}ESCAPED{)}ESCAPED{|}ESCAPED{Z}</font> +|-TestEnum [1200, 1273] : ESCAPED{TestEnum} +|--Case1 [1220, 1225] : ESCAPED{Case1} +|--returnType [1247, 1271] : ESCAPED{returnType}ESCAPED{(}ESCAPED{)}<font color="#999999">:ESCAPED{(}ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{)}ESCAPED{|}ESCAPED{Z}</font> diff --git a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/pureIntersectionTypes.pass b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/pureIntersectionTypes.pass index cfe872709b..63f903cf54 100644 --- a/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/pureIntersectionTypes.pass +++ b/php/php.editor/test/unit/data/goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/pureIntersectionTypes.pass @@ -2,15 +2,15 @@ |-Y [831, 835] : ESCAPED{Y} |-Z [842, 846] : ESCAPED{Z} |-paramType [857, 892] : ESCAPED{paramType}ESCAPED{(}<font color="#999999">ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{ }</font>ESCAPED{$test}ESCAPED{)}<font color="#999999">:ESCAPED{void}</font> -|-returnType [903, 929] : ESCAPED{returnType}ESCAPED{(}ESCAPED{)}<font color="#999999">:ESCAPED{\X}ESCAPED{&}ESCAPED{\Y}</font> +|-returnType [903, 929] : ESCAPED{returnType}ESCAPED{(}ESCAPED{)}<font color="#999999">:ESCAPED{X}ESCAPED{&}ESCAPED{Y}</font> |-TestClass [937, 1133] : ESCAPED{TestClass} |--$test [966, 970] : ESCAPED{$test}<font color="#999999">:ESCAPED{X}ESCAPED{&}ESCAPED{Y}</font> |--paramType [993, 1056] : ESCAPED{paramType}ESCAPED{(}<font color="#999999">ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{ }</font>ESCAPED{$test}ESCAPED{)}<font color="#999999">:ESCAPED{void}</font> -|--returnType [1078, 1131] : ESCAPED{returnType}ESCAPED{(}ESCAPED{)}<font color="#999999">:ESCAPED{\X}ESCAPED{&}ESCAPED{\Y}</font> +|--returnType [1078, 1131] : ESCAPED{returnType}ESCAPED{(}ESCAPED{)}<font color="#999999">:ESCAPED{X}ESCAPED{&}ESCAPED{Y}</font> |-TestTrait [1141, 1352] : ESCAPED{TestTrait} |--$test [1170, 1174] : ESCAPED{$test}<font color="#999999">:ESCAPED{X}ESCAPED{&}ESCAPED{Y}</font> |--paramType [1197, 1275] : ESCAPED{paramType}ESCAPED{(}<font color="#999999">ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{ }</font>ESCAPED{$test1}ESCAPED{, }<font color="#999999">ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{&}ESCAPED{Z}ESCAPED{ }</font>ESCAPED{$test2}ESCAPED{)}<font color="#999999">:ESCAPED{void}</font> -|--returnType [1297, 1350] : ESCAPED{returnType}ESCAPED{(}ESCAPED{)}<font color="#999999">:ESCAPED{\X}ESCAPED{&}ESCAPED{\Y}</font> -|-TestInterfase [1364, 1468] : ESCAPED{TestInterfase} +|--returnType [1297, 1350] : ESCAPED{returnType}ESCAPED{(}ESCAPED{)}<font color="#999999">:ESCAPED{X}ESCAPED{&}ESCAPED{Y}</font> +|-TestInterface [1364, 1468] : ESCAPED{TestInterface} |--paramType [1401, 1424] : ESCAPED{paramType}ESCAPED{(}<font color="#999999">ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{&}ESCAPED{Z}ESCAPED{ }</font>ESCAPED{$test}ESCAPED{)} -|--returnType [1445, 1465] : ESCAPED{returnType}ESCAPED{(}ESCAPED{)}<font color="#999999">:ESCAPED{\X}ESCAPED{&}ESCAPED{\Y}ESCAPED{&}ESCAPED{\Z}</font> +|--returnType [1445, 1465] : ESCAPED{returnType}ESCAPED{(}ESCAPED{)}<font color="#999999">:ESCAPED{X}ESCAPED{&}ESCAPED{Y}ESCAPED{&}ESCAPED{Z}</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 f54cd9161a..40221d31e3 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; + method : implmethod;implMethod;1685;$test:Test:1::1:0:0:0:0:0;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; + method : implmethod;implMethod;1440;$test:Test:1::1:0:0:0:0:0;void;1;0;<TESTURL>/testGetEnums.php;0;0;void; superiface : iface1;Iface1; superiface : iface2;Iface2; top : impl @@ -108,7 +108,7 @@ Searchable Keys: enum : withtrait;WithTrait;1805;;;;1;\TestTrait;0;<TESTURL>/testGetEnums.php; enum.case : a;A;1846;?;0;<TESTURL>/testGetEnums.php;1; enum.case : b;B;1858;?;0;<TESTURL>/testGetEnums.php;1; - method : staticmethod;staticMethod;1889;;void;9;0;<TESTURL>/testGetEnums.php;0;0; + method : staticmethod;staticMethod;1889;;void;9;0;<TESTURL>/testGetEnums.php;0;0;void; top : withtrait usedtrait : testtrait;TestTrait; @@ -197,7 +197,7 @@ Not Searchable Keys: Document 11 Searchable Keys: - method : test;test;1776;;void;9;0;<TESTURL>/testGetEnums.php;0;0; + method : test;test;1776;;void;9;0;<TESTURL>/testGetEnums.php;0;0;void; top : testtrait trait : testtrait;TestTrait;1737;;;0;<TESTURL>/testGetEnums.php; 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 792934cc4c..33285e1f11 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,9 +2,9 @@ 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 : bf;bf;183;;;;0;<TESTURL>/testGetFunctions.php;0;0; - base : cf;cf;202;;;;0;<TESTURL>/testGetFunctions.php;0;0; + 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 : bf;bf;183;;;;0;<TESTURL>/testGetFunctions.php;0;0;; + base : cf;cf;202;;;;0;<TESTURL>/testGetFunctions.php;0;0;; top : af top : bf top : cf diff --git a/php/php.editor/test/unit/data/testfiles/index/testGetMethods/testGetMethods.php.indexed b/php/php.editor/test/unit/data/testfiles/index/testGetMethods/testGetMethods.php.indexed index e5e6572db4..9730e6fb87 100644 --- a/php/php.editor/test/unit/data/testfiles/index/testGetMethods/testGetMethods.php.indexed +++ b/php/php.editor/test/unit/data/testfiles/index/testGetMethods/testGetMethods.php.indexed @@ -9,7 +9,7 @@ Not Searchable Keys: Document 1 Searchable Keys: clz : testmethoddeclaration;testMethodDeclaration;12;;;;1;;0;<TESTURL>/testGetMethods.php;; - method : testmethoddeclaration;testMethodDeclaration;56;;;1;0;<TESTURL>/testGetMethods.php;0;0; + method : testmethoddeclaration;testMethodDeclaration;56;;;1;0;<TESTURL>/testGetMethods.php;0;0;; top : testmethoddeclaration Not Searchable Keys: 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 f2d7422481..0b04b81e1d 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 46f809eea2..dcdf844a6c 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; + 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; 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 0d56d3636f..8bc49e6d74 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; - method : returntypestatic;returnTypeStatic;245;$num:int:1::1:0:0:0:0:0;?\Foo;9;0;<TESTURL>/testNullableTypesForMethods.php;0;0; + 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; 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 f53a4a9304..911c79da49 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,$y:int:1:0:0:0:0:0:1:0;;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,$y:int:1:0:0:0:0:0:1:0;;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,$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;; 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,$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 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,$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;; 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,$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 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,$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;; 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,$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 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,$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;; 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,$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 Document 5 diff --git a/php/php.editor/test/unit/data/testfiles/index/testPHP80MixedReturnType/testPHP80MixedReturnType.php.indexed b/php/php.editor/test/unit/data/testfiles/index/testPHP80MixedReturnType/testPHP80MixedReturnType.php.indexed index a268684346..738fc57e43 100644 --- a/php/php.editor/test/unit/data/testfiles/index/testPHP80MixedReturnType/testPHP80MixedReturnType.php.indexed +++ b/php/php.editor/test/unit/data/testfiles/index/testPHP80MixedReturnType/testPHP80MixedReturnType.php.indexed @@ -2,7 +2,7 @@ Document 0 Searchable Keys: - base : mixedreturntype;mixedReturnType;824;;mixed;;0;<TESTURL>/testPHP80MixedReturnType.php;0;0; + base : mixedreturntype;mixedReturnType;824;;mixed;;0;<TESTURL>/testPHP80MixedReturnType.php;0;0;mixed; top : mixedreturntype Not Searchable Keys: @@ -11,7 +11,7 @@ Not Searchable Keys: Document 1 Searchable Keys: clz : mixedtype;MixedType;877;;;;1;;0;<TESTURL>/testPHP80MixedReturnType.php;; - method : mixedreturntype;mixedReturnType;909;;mixed;1;0;<TESTURL>/testPHP80MixedReturnType.php;0;0; + method : mixedreturntype;mixedReturnType;909;;mixed;1;0;<TESTURL>/testPHP80MixedReturnType.php;0;0;mixed; top : mixedtype Not Searchable Keys: 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 8785e94070..2e095d224b 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; - 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; - 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; - 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; - 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; - 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; + 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; 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 0101479bfe..b0cca1e4b8 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; - method : staticmethod;staticMethod;1375;$iterable:iterable|null:1::1:0:0:1:0:0;\Test\Foo|\Bar;1036;0;<TESTURL>/testPHP80UnionTypesTypes.php;1;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; 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; - method : staticmethod;staticMethod;1045;$iterable:iterable|null:1::1:0:0:1:0:0;\Test\Foo|\Bar;9;0;<TESTURL>/testPHP80UnionTypesTypes.php;1;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; 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; - method : staticmethod;staticMethod;1840;$iterable:iterable|null:1::1:0:0:1:0:0;\Test\Foo|\Bar;9;0;<TESTURL>/testPHP80UnionTypesTypes.php;1;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; 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; - method : staticmethod;staticMethod;1553;$iterable:iterable|null:1::1:0:0:1:0:0;\Test\Foo|\Bar;1033;0;<TESTURL>/testPHP80UnionTypesTypes.php;1;0; + 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; 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 9ac3b74bec..80d20d38d4 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,12 +2,12 @@ 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; - 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; - base : lambdafunctiondeclaration:1537;LambdaFunctionDeclaration:1537;1537;$test:int:1::1:0:0:0:0:0;X&Y&Z;;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;1; - base : paramtype;paramType;857;$test:X&Y:1::1:0:0:0:0:1;void;;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;0; - base : returntype;returnType;903;;\X&\Y;;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;1; + 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 : returntype;returnType;903;;\X&\Y;;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;1;X&Y; top : $arrow top : $closure top : arrowfunctiondeclaration:1578 @@ -26,8 +26,8 @@ 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; - method : returntype;returnType;1078;;\X&\Y;1;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;1; + method : paramtype;paramType;993;$test:X&Y:1::1:0:0:0:0:1;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 Not Searchable Keys: @@ -60,8 +60,8 @@ 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; - method : returntype;returnType;1297;;\X&\Y;1;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;1; + 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 : 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,8 +163,8 @@ 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 : returntype;returnType;1445;;\X&\Y&\Z;1025;0;<TESTURL>/testPHP81PureIntersectionTypes.php;0;1; + method : paramtype;paramType;1401;$test:X&Y&Z:1::1:0:0:0:0:1;;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 Not Searchable Keys: diff --git a/php/php.editor/test/unit/data/testfiles/index/testPHP82ConstantsInTraits/testPHP82ConstantsInTraits.php.indexed b/php/php.editor/test/unit/data/testfiles/index/testPHP82ConstantsInTraits/testPHP82ConstantsInTraits.php.indexed index 4b9117dc18..06aa85d563 100644 --- a/php/php.editor/test/unit/data/testfiles/index/testPHP82ConstantsInTraits/testPHP82ConstantsInTraits.php.indexed +++ b/php/php.editor/test/unit/data/testfiles/index/testPHP82ConstantsInTraits/testPHP82ConstantsInTraits.php.indexed @@ -25,7 +25,7 @@ Searchable Keys: clz.const : private;PRIVATE;982;'private';0;<TESTURL>/testPHP82ConstantsInTraits.php;2; clz.const : protected;PROTECTED;939;'protected';0;<TESTURL>/testPHP82ConstantsInTraits.php;4; clz.const : public;PUBLIC;900;'public';0;<TESTURL>/testPHP82ConstantsInTraits.php;1; - method : method;method;1024;;void;1;0;<TESTURL>/testPHP82ConstantsInTraits.php;0;0; + method : method;method;1024;;void;1;0;<TESTURL>/testPHP82ConstantsInTraits.php;0;0;void; top : exampletrait trait : exampletrait;ExampleTrait;820;;;0;<TESTURL>/testPHP82ConstantsInTraits.php; diff --git a/php/php.editor/test/unit/data/testfiles/structure/pureIntersectionTypes.php b/php/php.editor/test/unit/data/testfiles/index/testPHP82DNFReturnTypes/testPHP82DNFReturnTypes.php similarity index 60% copy from php/php.editor/test/unit/data/testfiles/structure/pureIntersectionTypes.php copy to php/php.editor/test/unit/data/testfiles/index/testPHP82DNFReturnTypes/testPHP82DNFReturnTypes.php index 7d9f2bdd5e..b0e9177202 100644 --- a/php/php.editor/test/unit/data/testfiles/structure/pureIntersectionTypes.php +++ b/php/php.editor/test/unit/data/testfiles/index/testPHP82DNFReturnTypes/testPHP82DNFReturnTypes.php @@ -21,47 +21,30 @@ class X {} class Y {} class Z {} -function paramType(X&Y $test): void { - -} - -function returnType(): X&Y { - +function returnType(): (X&Y)|(X&Z) { } class TestClass { - private X&Y $test; - - public function paramType(X&Y $test): void { - $this->test = $test; - } - - public function returnType(): X&Y { + public function returnType(): (X&Y)|Z|X { return $this->test; } } trait TestTrait { - private X&Y $test; - - public function paramType(X&Y $test1, X&Y&Z $test2): void { - $this->test = $test; - } - - public function returnType(): X&Y { + public function returnType(): (X&Y)|(Y&Z) { return $this->test; } } interface TestInterfase { + public function returnType(): X|(X&Y&Z)|Z; +} - public function paramType(X&Y&Z $test); - public function returnType(): X&Y&Z; - +enum TestEnum { + case Case1; + public function returnType(): (X&Y)|Z {} } -$closure = function(X&Y&Z $test1, Y&Z $test2): void {}; -$closure = function(int $test): X&Y&Z {}; +$closure = function(int $test): (X&Y&Z)|(X&Z) {}; -$arrow = fn(X&Y $test) => $test; -$arrow = fn(X&Y $test): X&Y => $test; +$arrow = fn(): (X&Y)|(Y&Z)|(X&Z) => $test; 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 new file mode 100644 index 0000000000..3d895c7866 --- /dev/null +++ b/php/php.editor/test/unit/data/testfiles/index/testPHP82DNFReturnTypes/testPHP82DNFReturnTypes.php.indexed @@ -0,0 +1,136 @@ + + +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 : returntype;returnType;857;;(\X&\Y)|(\X&\Z);;0;<TESTURL>/testPHP82DNFReturnTypes.php;1;0;(X&Y)|(X&Z); + top : $arrow + top : $closure + top : arrowfunctiondeclaration:1308 + top : lambdafunctiondeclaration:1259 + top : returntype + var : $arrow;$arrow;;1300;0;<TESTURL>/testPHP82DNFReturnTypes.php; + var : $closure;$closure;;1249;0;<TESTURL>/testPHP82DNFReturnTypes.php; + +Not Searchable Keys: + + +Document 1 +Searchable Keys: + clz : testclass;TestClass;894;;;;1;;0;<TESTURL>/testPHP82DNFReturnTypes.php;; + method : returntype;returnType;926;;(\X&\Y)|\Z|\X;1;0;<TESTURL>/testPHP82DNFReturnTypes.php;1;0;(X&Y)|Z|X; + top : testclass + +Not Searchable Keys: + + +Document 2 +Searchable Keys: + clz : x;X;820;;;;1;;0;<TESTURL>/testPHP82DNFReturnTypes.php;; + top : x + +Not Searchable Keys: + + +Document 3 +Searchable Keys: + clz : y;Y;831;;;;1;;0;<TESTURL>/testPHP82DNFReturnTypes.php;; + top : y + +Not Searchable Keys: + + +Document 4 +Searchable Keys: + clz : z;Z;842;;;;1;;0;<TESTURL>/testPHP82DNFReturnTypes.php;; + top : z + +Not Searchable Keys: + + +Document 5 +Searchable Keys: + enum : testenum;TestEnum;1173;;;;1;;0;<TESTURL>/testPHP82DNFReturnTypes.php; + enum.case : case1;Case1;1193;?;0;<TESTURL>/testPHP82DNFReturnTypes.php;1; + method : returntype;returnType;1220;;(\X&\Y)|\Z;1;0;<TESTURL>/testPHP82DNFReturnTypes.php;1;0;(X&Y)|Z; + top : testenum + +Not Searchable Keys: + + +Document 6 +Searchable Keys: + identifier_used : arrow; + identifier_used : case1; + identifier_used : closure; + identifier_used : int; + identifier_used : returntype; + identifier_used : returntype; + identifier_used : returntype; + identifier_used : returntype; + identifier_used : returntype; + 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 : 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 : 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 7 +Searchable Keys: + iface : testinterfase;TestInterfase;1102;;;0;<TESTURL>/testPHP82DNFReturnTypes.php; + method : returntype;returnType;1138;;\X|(\X&\Y&\Z)|\Z;1025;0;<TESTURL>/testPHP82DNFReturnTypes.php;1;0;X|(X&Y&Z)|Z; + top : testinterfase + +Not Searchable Keys: + + +Document 8 +Searchable Keys: + method : returntype;returnType;1027;;(\X&\Y)|(\Y&\Z);1;0;<TESTURL>/testPHP82DNFReturnTypes.php;1;0;(X&Y)|(Y&Z); + top : testtrait + trait : testtrait;TestTrait;995;;;0;<TESTURL>/testPHP82DNFReturnTypes.php; + +Not Searchable Keys: diff --git a/php/php.editor/test/unit/data/testfiles/structure/pureIntersectionTypes.php b/php/php.editor/test/unit/data/testfiles/structure/php82/deprecatedDnfReturnTypes_01.php similarity index 59% copy from php/php.editor/test/unit/data/testfiles/structure/pureIntersectionTypes.php copy to php/php.editor/test/unit/data/testfiles/structure/php82/deprecatedDnfReturnTypes_01.php index 7d9f2bdd5e..e8222d8651 100644 --- a/php/php.editor/test/unit/data/testfiles/structure/pureIntersectionTypes.php +++ b/php/php.editor/test/unit/data/testfiles/structure/php82/deprecatedDnfReturnTypes_01.php @@ -20,48 +20,35 @@ class X {} class Y {} class Z {} +/** + * @deprecated + */ +class DeprecatedType {} -function paramType(X&Y $test): void { - -} - -function returnType(): X&Y { - +function returnType(): (X&Y&DeprecatedType)|(X&Z)|DeprecatedType { } class TestClass { - private X&Y $test; - - public function paramType(X&Y $test): void { - $this->test = $test; - } - - public function returnType(): X&Y { + public function returnType(): (DeprecatedType&Y)|Z|X { return $this->test; } } trait TestTrait { - private X&Y $test; - - public function paramType(X&Y $test1, X&Y&Z $test2): void { - $this->test = $test; - } - - public function returnType(): X&Y { + public function returnType(): (X&Y)|(Y&Z&DeprecatedType) { return $this->test; } } -interface TestInterfase { - - public function paramType(X&Y&Z $test); - public function returnType(): X&Y&Z; +interface TestInterface { + public function returnType(): X|(X&Y&Z)|DeprecatedType; +} +enum TestEnum { + case Case1; + public function returnType(): (X&Y)|DeprecatedType {} } -$closure = function(X&Y&Z $test1, Y&Z $test2): void {}; -$closure = function(int $test): X&Y&Z {}; +$closure = function(int $test): (X&Y&Z)|(DeprecatedType&Z) {}; -$arrow = fn(X&Y $test) => $test; -$arrow = fn(X&Y $test): X&Y => $test; +$arrow = fn($test): (X&DeprecatedType)|(Y&Z)|(X&Z) => $test; diff --git a/php/php.editor/test/unit/data/testfiles/structure/pureIntersectionTypes.php b/php/php.editor/test/unit/data/testfiles/structure/php82/dnfReturnTypes.php similarity index 59% copy from php/php.editor/test/unit/data/testfiles/structure/pureIntersectionTypes.php copy to php/php.editor/test/unit/data/testfiles/structure/php82/dnfReturnTypes.php index 7d9f2bdd5e..5c85d8afd2 100644 --- a/php/php.editor/test/unit/data/testfiles/structure/pureIntersectionTypes.php +++ b/php/php.editor/test/unit/data/testfiles/structure/php82/dnfReturnTypes.php @@ -20,48 +20,32 @@ class X {} class Y {} class Z {} +class Test {} -function paramType(X&Y $test): void { - -} - -function returnType(): X&Y { - +function returnType(): (X&Y&Test)|(X&Z) { } class TestClass { - private X&Y $test; - - public function paramType(X&Y $test): void { - $this->test = $test; - } - - public function returnType(): X&Y { + public function returnType(): (Test&Y)|Z|X { return $this->test; } } trait TestTrait { - private X&Y $test; - - public function paramType(X&Y $test1, X&Y&Z $test2): void { - $this->test = $test; - } - - public function returnType(): X&Y { + public function returnType(): (X&Y)|(Y&Z&Test) { return $this->test; } } -interface TestInterfase { - - public function paramType(X&Y&Z $test); - public function returnType(): X&Y&Z; +interface TestInterface { + public function returnType(): X|(X&Y&Z)|Z; +} +enum TestEnum { + case Case1; + public function returnType(): (X&Y)|Z {} } -$closure = function(X&Y&Z $test1, Y&Z $test2): void {}; -$closure = function(int $test): X&Y&Z {}; +$closure = function(int $test): (X&Y&Z)|(X&Z) {}; -$arrow = fn(X&Y $test) => $test; -$arrow = fn(X&Y $test): X&Y => $test; +$arrow = fn($test): (X&Y)|(Y&Z)|(X&Z) => $test; diff --git a/php/php.editor/test/unit/data/testfiles/structure/pureIntersectionTypes.php b/php/php.editor/test/unit/data/testfiles/structure/pureIntersectionTypes.php index 7d9f2bdd5e..7ae96bf25b 100644 --- a/php/php.editor/test/unit/data/testfiles/structure/pureIntersectionTypes.php +++ b/php/php.editor/test/unit/data/testfiles/structure/pureIntersectionTypes.php @@ -53,7 +53,7 @@ trait TestTrait { } } -interface TestInterfase { +interface TestInterface { public function paramType(X&Y&Z $test); public function returnType(): X&Y&Z; 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 9046fd0a67..bcae5f7978 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 @@ -62,6 +62,10 @@ public class NavigatorDeprecatedTest extends PhpNavigatorTestBase { performTest("structure/deprecatedInheritedDeclarations"); } + public void testDeprecatedTypesForDNFReturnTypes_01() throws Exception { + performTest("structure/php82/deprecatedDnfReturnTypes_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 3d8c5d44c1..f76858029c 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 @@ -132,4 +132,8 @@ public class NavigatorTest extends PhpNavigatorTestBase { performTest("structure/php82/constantsInTraits"); } + public void testDNFReturnTypes() throws Exception { + performTest("structure/php82/dnfReturnTypes"); + } + } 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 bffc1aeee0..7d0661e800 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 @@ -764,6 +764,10 @@ public class PHPIndexTest extends PHPNavTestBase { checkIndexer(getTestPath()); } + public void testPHP82DNFReturnTypes() 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