Add the `getInterfaces()` method to the `TypeDeclaration` instead of the `getInterfaes()`
diff --git a/php/php.editor/nbproject/project.properties b/php/php.editor/nbproject/project.properties
index f7b6023..f976f18 100644
--- a/php/php.editor/nbproject/project.properties
+++ b/php/php.editor/nbproject/project.properties
@@ -18,7 +18,7 @@
javac.compilerargs=-Xlint -Xlint:-serial
nbjavac.ignore.missing.enclosing=**/CUP$ASTPHP5Parser$actions.class
nbm.needs.restart=true
-spec.version.base=2.33.0
+spec.version.base=2.34.0
release.external/predefined_vars-1.0.zip=docs/predefined_vars.zip
sigtest.gen.fail.on.error=false
diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/codegen/SemiAttribute.java b/php/php.editor/src/org/netbeans/modules/php/editor/codegen/SemiAttribute.java
index 7ac62d0..cc0690e 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/codegen/SemiAttribute.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/codegen/SemiAttribute.java
@@ -406,7 +406,7 @@
ClassElementAttribute ce = (ClassElementAttribute) global.enterWrite(name, Kind.IFACE, node);
node2Element.put(node, ce);
- List<Expression> interfaes = node.getInterfaes();
+ List<Expression> interfaes = node.getInterfaces();
for (Expression identifier : interfaes) {
ClassElementAttribute iface = (ClassElementAttribute) lookup(CodeUtils.extractUnqualifiedName(identifier), Kind.IFACE);
ce.ifaces.add(iface);
@@ -437,7 +437,7 @@
if (superClsName != null) {
ce.superClass = (ClassElementAttribute) lookup(superClsName.getName(), Kind.CLASS);
}
- List<Expression> interfaes = node.getInterfaes();
+ List<Expression> interfaes = node.getInterfaces();
for (Expression identifier : interfaes) {
ClassElementAttribute iface = (ClassElementAttribute) lookup(CodeUtils.extractUnqualifiedName(identifier), Kind.IFACE);
ce.ifaces.add(iface);
@@ -797,7 +797,7 @@
ce.superClass = (ClassElementAttribute) lookup(superClsName.getName(), Kind.CLASS);
node2Element.put(node.getSuperClass(), ce.superClass);
}
- List<Expression> interfaces = node.getInterfaes();
+ List<Expression> interfaces = node.getInterfaces();
for (Expression identifier : interfaces) {
//TODO: ifaces must be fixed;
}
diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletion.java b/php/php.editor/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletion.java
index a8fa21d..cc1039a 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletion.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletion.java
@@ -2761,7 +2761,7 @@
@Override
public List<Expression> getInterfaces() {
- return classDeclaration.getInterfaes();
+ return classDeclaration.getInterfaces();
}
@Override
@@ -2820,7 +2820,7 @@
@Override
public List<Expression> getInterfaces() {
- return enumDeclaration.getInterfaes();
+ return enumDeclaration.getInterfaces();
}
@Override
diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/csl/SemanticAnalysis.java b/php/php.editor/src/org/netbeans/modules/php/editor/csl/SemanticAnalysis.java
index f67e3c2..2ce27d1 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/csl/SemanticAnalysis.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/csl/SemanticAnalysis.java
@@ -406,7 +406,7 @@
typeInfo = new TypeDeclarationTypeInfo(cldec);
scan(cldec.getAttributes());
scan(cldec.getSuperClass());
- scan(cldec.getInterfaes());
+ scan(cldec.getInterfaces());
Identifier name = cldec.getName();
addColoringForNode(name, createTypeNameColoring(name));
needToScan.put(typeInfo, new ArrayList<>());
@@ -655,7 +655,7 @@
}
addToPath(node);
scan(node.getAttributes());
- scan(node.getInterfaes());
+ scan(node.getInterfaces());
typeInfo = new TypeDeclarationTypeInfo(node);
Identifier name = node.getName();
addColoringForNode(name, createTypeNameColoring(name));
diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/indent/FormatVisitor.java b/php/php.editor/src/org/netbeans/modules/php/editor/indent/FormatVisitor.java
index 11058e1..19d9dcd 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/indent/FormatVisitor.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/indent/FormatVisitor.java
@@ -743,10 +743,10 @@
addFormatToken(formatTokens);
break;
case PHP_IMPLEMENTS:
- if (!node.getInterfaes().isEmpty()) {
+ if (!node.getInterfaces().isEmpty()) {
formatTokens.add(new FormatToken(FormatToken.Kind.WHITESPACE_BEFORE_EXTENDS_IMPLEMENTS, ts.offset()));
ts.movePrevious();
- addListOfNodes(node.getInterfaes(), FormatToken.Kind.WHITESPACE_IN_INTERFACE_LIST);
+ addListOfNodes(node.getInterfaces(), FormatToken.Kind.WHITESPACE_IN_INTERFACE_LIST);
}
break;
case PHP_EXTENDS:
@@ -761,7 +761,7 @@
ts.movePrevious();
scan(node.getName());
scan(node.getSuperClass());
- scan(node.getInterfaes());
+ scan(node.getInterfaces());
scan(node.getBody());
}
@@ -807,10 +807,10 @@
while (ts.moveNext() && ts.token().id() != PHPTokenId.PHP_CURLY_OPEN) {
switch (ts.token().id()) {
case PHP_IMPLEMENTS:
- if (!node.getInterfaes().isEmpty()) {
+ if (!node.getInterfaces().isEmpty()) {
formatTokens.add(new FormatToken(FormatToken.Kind.WHITESPACE_BEFORE_EXTENDS_IMPLEMENTS, ts.offset()));
ts.movePrevious();
- addListOfNodes(node.getInterfaes(), FormatToken.Kind.WHITESPACE_IN_INTERFACE_LIST);
+ addListOfNodes(node.getInterfaces(), FormatToken.Kind.WHITESPACE_IN_INTERFACE_LIST);
}
break;
default:
@@ -821,7 +821,7 @@
ts.movePrevious();
scan(node.getName());
scan(node.getBackingType());
- scan(node.getInterfaes());
+ scan(node.getInterfaces());
scan(node.getBody());
}
diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/OccurenceBuilder.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/OccurenceBuilder.java
index 3dd5cea..fbb3d8e 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/OccurenceBuilder.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/OccurenceBuilder.java
@@ -425,7 +425,7 @@
prepare(Kind.CLASS, classDeclaration.getSuperClass(), scope);
}
}
- List<Expression> interfaes = classDeclaration.getInterfaes();
+ List<Expression> interfaes = classDeclaration.getInterfaces();
for (Expression iface : interfaes) {
QualifiedName ifaceName = QualifiedName.create(iface);
if (ifaceName != null && VariousUtils.isAlias(ifaceName, classDeclaration.getStartOffset(), scope)) {
@@ -441,7 +441,7 @@
if (canBePrepared(interfaceDeclaration, scope)) {
InterfaceDeclarationInfo node = InterfaceDeclarationInfo.create(interfaceDeclaration);
ifaceDeclarations.put(node, scope);
- List<Expression> interfaes = interfaceDeclaration.getInterfaes();
+ List<Expression> interfaes = interfaceDeclaration.getInterfaces();
for (Expression iface : interfaes) {
prepare(Kind.IFACE, iface, scope);
}
@@ -459,7 +459,7 @@
if (canBePrepared(enumDeclaration, scope)) {
EnumDeclarationInfo node = EnumDeclarationInfo.create(enumDeclaration);
enumDeclarations.put(node, scope);
- List<Expression> interfaes = enumDeclaration.getInterfaes();
+ List<Expression> interfaes = enumDeclaration.getInterfaces();
for (Expression iface : interfaes) {
QualifiedName ifaceName = QualifiedName.create(iface);
if (ifaceName != null && VariousUtils.isAlias(ifaceName, enumDeclaration.getStartOffset(), scope)) {
diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/ClassDeclarationInfo.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/ClassDeclarationInfo.java
index 55465e0..d15f0e2 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/ClassDeclarationInfo.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/ClassDeclarationInfo.java
@@ -78,12 +78,12 @@
}
public List<? extends Expression> getInterfaces() {
- return getOriginalNode().getInterfaes();
+ return getOriginalNode().getInterfaces();
}
public Set<QualifiedName> getInterfaceNames() {
final Set<QualifiedName> retval = new HashSet<>();
- final List<Expression> interfaes = getOriginalNode().getInterfaes();
+ final List<Expression> interfaes = getOriginalNode().getInterfaces();
for (Expression iface : interfaes) {
QualifiedName ifaceName = QualifiedName.create(iface);
if (ifaceName != null) {
diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/EnumDeclarationInfo.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/EnumDeclarationInfo.java
index b20b9d6..901f267 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/EnumDeclarationInfo.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/EnumDeclarationInfo.java
@@ -61,12 +61,12 @@
}
public List<? extends Expression> getInterfaces() {
- return getOriginalNode().getInterfaes();
+ return getOriginalNode().getInterfaces();
}
public Set<QualifiedName> getInterfaceNames() {
final Set<QualifiedName> retval = new HashSet<>();
- final List<Expression> interfaes = getOriginalNode().getInterfaes();
+ final List<Expression> interfaes = getOriginalNode().getInterfaces();
for (Expression iface : interfaes) {
QualifiedName ifaceName = QualifiedName.create(iface);
if (ifaceName != null) {
diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/InterfaceDeclarationInfo.java b/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/InterfaceDeclarationInfo.java
index 887f2ea..8c56071 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/InterfaceDeclarationInfo.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/InterfaceDeclarationInfo.java
@@ -66,12 +66,12 @@
}
public List<? extends Expression> getInterfaces() {
- return getOriginalNode().getInterfaes();
+ return getOriginalNode().getInterfaces();
}
public Set<QualifiedName> getInterfaceNames() {
final Set<QualifiedName> retval = new HashSet<>();
- final List<Expression> interfaes = getOriginalNode().getInterfaes();
+ final List<Expression> interfaes = getOriginalNode().getInterfaces();
for (Expression iface : interfaes) {
QualifiedName ifaceName = QualifiedName.create(iface);
if (ifaceName != null) {
diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/ClassDeclaration.java b/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/ClassDeclaration.java
index 47698b5..1087e8b 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/ClassDeclaration.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/ClassDeclaration.java
@@ -109,7 +109,7 @@
declaration.getModifiers(),
declaration.getName(),
declaration.getSuperClass(),
- declaration.getInterfaes(),
+ declaration.getInterfaces(),
declaration.getBody(),
attributes
);
@@ -152,7 +152,7 @@
sbModifiers.append(mod).append(" "); // NOI18N
}
StringBuilder sb = new StringBuilder();
- for (Expression expression : getInterfaes()) {
+ for (Expression expression : getInterfaces()) {
sb.append(expression).append(","); //NOI18N
}
return sbAttributes.toString() + sbModifiers + "class " + getName() + " extends " + getSuperClass() + " implements " + sb + getBody(); //NOI18N
diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/EnumDeclaration.java b/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/EnumDeclaration.java
index 17b942b..9fe2899 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/EnumDeclaration.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/EnumDeclaration.java
@@ -80,7 +80,7 @@
declaration.getEndOffset(),
declaration.getName(),
declaration.getBackingType(),
- declaration.getInterfaes(),
+ declaration.getInterfaces(),
declaration.getBody(),
attributes
);
@@ -101,7 +101,7 @@
StringBuilder sbAttributes = new StringBuilder();
getAttributes().forEach(attribute -> sbAttributes.append(attribute).append(" ")); // NOI18N
StringBuilder sb = new StringBuilder();
- for (Expression expression : getInterfaes()) {
+ for (Expression expression : getInterfaces()) {
sb.append(expression).append(","); // NOI18N
}
return sbAttributes.toString() + "enum " + getName() + backingType == null ? "" : ": " + backingType + " implements " + sb + getBody(); // NOI18N
diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/InterfaceDeclaration.java b/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/InterfaceDeclaration.java
index 51acad8..8b75f78 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/InterfaceDeclaration.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/InterfaceDeclaration.java
@@ -55,7 +55,7 @@
start,
declaration.getEndOffset(),
declaration.getName(),
- declaration.getInterfaes(),
+ declaration.getInterfaces(),
declaration.getBody(),
attributes
);
diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/TypeDeclaration.java b/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/TypeDeclaration.java
index f369c7c..ce7d417 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/TypeDeclaration.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/TypeDeclaration.java
@@ -75,9 +75,21 @@
* List of interfaces that this type implements / extends.
*
* @return interfaces
+ * @deprecated instead, use {@link #getInterfaces()}
*/
+ @Deprecated
public List<Expression> getInterfaes() {
- return Collections.unmodifiableList(this.interfaces);
+ return getInterfaces();
+ }
+
+ /**
+ * List of interfaces that this type implements / extends.
+ *
+ * @return interfaces
+ * @since 2.34.0
+ */
+ public List<Expression> getInterfaces() {
+ return Collections.unmodifiableList(interfaces);
}
/**
@@ -111,7 +123,7 @@
StringBuilder sbAttributes = new StringBuilder();
getAttributes().forEach(attribute -> sbAttributes.append(attribute).append(" ")); // NOI18N
StringBuilder sb = new StringBuilder();
- for (Expression expression : getInterfaes()) {
+ for (Expression expression : getInterfaces()) {
sb.append(expression).append(","); //NOI18N
}
return sbAttributes.toString() + getName() + (sb.length() > 0 ? " " + sb.toString() : " ") + getBody(); //NOI18N
diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/visitors/DefaultVisitor.java b/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/visitors/DefaultVisitor.java
index 6e547f6..6363d83 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/visitors/DefaultVisitor.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/parser/astnodes/visitors/DefaultVisitor.java
@@ -249,7 +249,7 @@
scan(node.getAttributes());
scan(node.getName());
scan(node.getSuperClass());
- scan(node.getInterfaes());
+ scan(node.getInterfaces());
scan(node.getBody());
}
@@ -326,7 +326,7 @@
scan(node.getAttributes());
scan(node.getName());
scan(node.getBackingType());
- scan(node.getInterfaes());
+ scan(node.getInterfaces());
scan(node.getBody());
}
@@ -454,7 +454,7 @@
public void visit(InterfaceDeclaration node) {
scan(node.getAttributes());
scan(node.getName());
- scan(node.getInterfaes());
+ scan(node.getInterfaces());
scan(node.getBody());
}
diff --git a/php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectEnumHintError.java b/php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectEnumHintError.java
index 60a9c3d..f585214 100644
--- a/php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectEnumHintError.java
+++ b/php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectEnumHintError.java
@@ -284,7 +284,7 @@
scan(node.getAttributes());
scan(node.getName());
scan(node.getSuperClass());
- scan(node.getInterfaes());
+ scan(node.getInterfaces());
checkEnumCases(node.getBody().getStatements());
}
@@ -318,7 +318,7 @@
}
scan(node.getAttributes());
scan(node.getName());
- scan(node.getInterfaes());
+ scan(node.getInterfaces());
Expression backingType = node.getBackingType();
if (backingType != null) {
String name = CodeUtils.extractQualifiedName(backingType);
diff --git a/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/parser/PrintASTVisitor.java b/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/parser/PrintASTVisitor.java
index e55bc84..77c950e 100644
--- a/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/parser/PrintASTVisitor.java
+++ b/php/php.editor/test/unit/src/org/netbeans/modules/php/editor/parser/PrintASTVisitor.java
@@ -340,7 +340,7 @@
}
printNode.addChildrenGroup("ClassName", new ASTNode[]{classDeclaration.getName()});
printNode.addChildrenGroup("SuperClassName", new ASTNode[]{classDeclaration.getSuperClass()});
- printNode.addChildrenGroup("Interfaces", classDeclaration.getInterfaes());
+ printNode.addChildrenGroup("Interfaces", classDeclaration.getInterfaces());
printNode.addChild(classDeclaration.getBody());
printNode.print(this);
}
@@ -450,7 +450,7 @@
}
printNode.addChildrenGroup("EnumName", new ASTNode[]{enumDeclaration.getName()});
printNode.addChildrenGroup("BackingType", new ASTNode[]{enumDeclaration.getBackingType()});
- printNode.addChildrenGroup("Interfaces", enumDeclaration.getInterfaes());
+ printNode.addChildrenGroup("Interfaces", enumDeclaration.getInterfaces());
printNode.addChild(enumDeclaration.getBody());
printNode.print(this);
}