You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "KacerCZ (via GitHub)" <gi...@apache.org> on 2023/01/22 12:18:18 UTC

[GitHub] [netbeans] KacerCZ opened a new pull request, #5341: Improved method checks in enum declaration

KacerCZ opened a new pull request, #5341:
URL: https://github.com/apache/netbeans/pull/5341

   - Checks declaration of forbidden methods.
   - Adds __invoke and __debugInfo to list of magic methods.
   
   Docs:
   - https://www.php.net/manual/en/language.enumerations.listing.php
   - https://www.php.net/manual/en/class.backedenum.php
   - https://www.php.net/manual/en/language.enumerations.object-differences.php
   - https://www.php.net/manual/en/language.oop5.magic.php
   
   Closes  #5086, closes  #5094


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] mbien commented on pull request #5341: Improved method checks in enum declaration

Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on PR #5341:
URL: https://github.com/apache/netbeans/pull/5341#issuecomment-1399570326

   fyi: if you want to get bug fixes into NB17 there is still a chance during the RC phase. All you have to do is to rebase on `delivery` and change the PR target to `delivery` too.


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] KacerCZ commented on pull request #5341: Improved method checks in enum declaration

Posted by "KacerCZ (via GitHub)" <gi...@apache.org>.
KacerCZ commented on PR #5341:
URL: https://github.com/apache/netbeans/pull/5341#issuecomment-1399876715

   Thanks for the review.
   I've updated the commit message.


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] neilcsmith-net merged pull request #5341: Improved method checks in enum declaration

Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net merged PR #5341:
URL: https://github.com/apache/netbeans/pull/5341


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] KacerCZ commented on pull request #5341: Improved method checks in enum declaration

Posted by "KacerCZ (via GitHub)" <gi...@apache.org>.
KacerCZ commented on PR #5341:
URL: https://github.com/apache/netbeans/pull/5341#issuecomment-1400301461

   @junichi11 OK, I didn't wanted to pressure you with the review by targeting NB17.
   @neilcsmith-net I changed target branch and target milestone.


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on pull request #5341: Improved method checks in enum declaration

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on PR #5341:
URL: https://github.com/apache/netbeans/pull/5341#issuecomment-1400112956

   As @mbien wrote, I think we can change the target to NB17.


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] neilcsmith-net commented on pull request #5341: Improved method checks in enum declaration

Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on PR #5341:
URL: https://github.com/apache/netbeans/pull/5341#issuecomment-1400124837

   @KacerCZ OK, please make sure this is based on top of delivery and update the PR base branch and milestone if you want this to go in to NB17.  Will keep an eye out for it.


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on a diff in pull request #5341: Improved method checks in enum declaration

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #5341:
URL: https://github.com/apache/netbeans/pull/5341#discussion_r1083558146


##########
php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectEnumHintError.java:
##########
@@ -142,13 +167,22 @@ private void checkTraits(Collection<? extends TraitScope> traits, EnumScope enum
         }
     }
 
-    private void checkConstructor(Collection<? extends MethodScope> methods, List<Hint> hints) {
+    private void checkMethods(Collection<? extends MethodScope> methods, boolean isBackedEnum, List<Hint> hints) {
         for (MethodScope method : methods) {
             if (CancelSupport.getDefault().isCancelled()) {
                 return;
             }
             if (method.isConstructor()) {
                 addHint(method, Bundle.IncorrectEnumHintError_incorrectEnumConstructor(), hints);
+                continue;
+            }
+            String methodName = method.getName().toLowerCase();
+            if ("cases".equals(methodName)) {

Review Comment:
   `NOI18N`



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] junichi11 commented on pull request #5341: Improved method checks in enum declaration

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on PR #5341:
URL: https://github.com/apache/netbeans/pull/5341#issuecomment-1399630829

   We should add the following URLs and issue numbers to the commit message.
   
   > Docs:
   > 
   > * https://www.php.net/manual/en/language.enumerations.listing.php
   > * https://www.php.net/manual/en/class.backedenum.php
   > * https://www.php.net/manual/en/language.enumerations.object-differences.php
   > * https://www.php.net/manual/en/language.oop5.magic.php
   
   


-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] KacerCZ commented on a diff in pull request #5341: Improved method checks in enum declaration

Posted by "KacerCZ (via GitHub)" <gi...@apache.org>.
KacerCZ commented on code in PR #5341:
URL: https://github.com/apache/netbeans/pull/5341#discussion_r1083685596


##########
php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectEnumHintError.java:
##########
@@ -142,13 +167,22 @@ private void checkTraits(Collection<? extends TraitScope> traits, EnumScope enum
         }
     }
 
-    private void checkConstructor(Collection<? extends MethodScope> methods, List<Hint> hints) {
+    private void checkMethods(Collection<? extends MethodScope> methods, boolean isBackedEnum, List<Hint> hints) {
         for (MethodScope method : methods) {
             if (CancelSupport.getDefault().isCancelled()) {
                 return;
             }
             if (method.isConstructor()) {
                 addHint(method, Bundle.IncorrectEnumHintError_incorrectEnumConstructor(), hints);
+                continue;
+            }
+            String methodName = method.getName().toLowerCase();
+            if ("cases".equals(methodName)) {

Review Comment:
   Fixed.



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists