tmysik commented on code in PR #6951:
URL: https://github.com/apache/netbeans/pull/6951#discussion_r1451473193


##########
php/php.editor/src/org/netbeans/modules/php/editor/PredefinedSymbols.java:
##########
@@ -107,13 +107,57 @@ public final class PredefinedSymbols {
                 "__unserialize", // NOI18N PHP 7.4
             })));
 
+    public static final Set<String> ATTRIBUTE_NAMES = 
Collections.unmodifiableSet(Attributes.ATTRIBUTE_NAMES);
+    public static final Set<String> ATTRIBUTE_FQ_NAMES = 
Collections.unmodifiableSet(Attributes.ATTRIBUTE_FQ_NAMES);
+
     public static enum VariableKind {
         STANDARD,
         THIS,
         SELF,
         PARENT
     };
 
+    // https://www.php.net/manual/en/reserved.attributes.php
+    public static enum Attributes {
+        ATTRIBUTE("Attribute"), // NOI18N
+        ALLOW_DYNAMIC_PROPERTIES("AllowDynamicProperties"), // NOI18N
+        OVERRIDE("Override"), // NOI18N
+        RETURN_TYPE_WILL_CHANGE("ReturnTypeWillChange"), // NOI18N
+        SENSITIVE_PARAMETER("SensitiveParameter"), // NOI18N
+        ;
+
+        private final String name;
+        private final String fqName;
+        private final String asAttributeExpression;
+        private static final Set<String> ATTRIBUTE_NAMES = new HashSet<>();
+        private static final Set<String> ATTRIBUTE_FQ_NAMES = new HashSet<>();
+
+        static {
+            for (Attributes attribute : Attributes.values()) {
+                ATTRIBUTE_NAMES.add(attribute.getName());
+                ATTRIBUTE_FQ_NAMES.add(attribute.getFqName());

Review Comment:
   Nitpick: I would rather see these constants to be really constant (also, 
that would be a bit better from the memory point of view, I think). Something 
like:
   
   ```java
   List<String> names = new ArrayList<>();
   List<String> fqNames = new ArrayList<>();
   for (Attributes attribute : Attributes.values()) {
       names.add(attribute.getName());
       fqNames.add(attribute.getFqName());
   }
   ATTRIBUTE_NAMES = Set.of(names);
   ATTRIBUTE_FQ_NAMES = Set.of(fqNames);
   ```
   
   But this is really a nitpick, feel free to ignore it completely, of course :)
   



-- 
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

Reply via email to