tmysik commented on code in PR #6896:
URL: https://github.com/apache/netbeans/pull/6896#discussion_r1438891270
##########
php/php.editor/src/org/netbeans/modules/php/editor/elements/MethodElementImpl.java:
##########
@@ -121,10 +126,66 @@ public static MethodElement createMagicMethod(final
TypeElement type, String met
return retval;
}
+ public static MethodElement createMagicMethod(final TypeElement type,
String methodName, int flags, List<Pair<String, String>> arguments, String
returnType) {
+ MethodElement retval = new MethodElementImpl(
+ type,
+ methodName,
+ true,
+ 0,
+ flags,
+ type.getFilenameUrl(),
+ null,
+
BaseFunctionElementSupport.ParametersImpl.create(fromParameterNames(arguments)),
+ BaseFunctionElementSupport.ReturnTypesImpl.create(returnType),
+ type.isDeprecated());
+ return retval;
+ }
+
+ static String getValidType(@NullAllowed String declaredType, @NullAllowed
PhpVersion phpVersion) {
+ if (declaredType == null) {
+ return CodeUtils.EMPTY_STRING;
+ }
+ String type = declaredType.trim();
+ if (phpVersion != null) {
+ switch (type) {
+ case Type.MIXED:
+ return phpVersion.hasMixedType() ? declaredType :
CodeUtils.EMPTY_STRING;
+ case Type.OBJECT:
+ return phpVersion.hasObjectType() ? declaredType :
CodeUtils.EMPTY_STRING;
+ case Type.VOID:
+ return phpVersion.hasVoidReturnType() ? declaredType :
CodeUtils.EMPTY_STRING;
+ default:
+ break;
Review Comment:
I see, thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists