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

   - #8035
   - https://wiki.php.net/rfc#php_84
   - https://wiki.php.net/rfc/asymmetric-visibility-v2
   - https://www.php.net/manual/en/language.oop5.final.php
   
   ### PHP 8.4 Support: Asymmetric Visibility v2 (Part 1) 
   
   - Fix the lexers and the parser(grammar file)
   - Support for the `final` field(property)
   - Don't handle modifier errors for methods, constants, and fields in the 
parser. Instead, handle them in the hint error.
     Writing all valid cases for each member is very hard and complicated 
because the current PHP has many modifiers.
   - Fix the `PHP84UnhandledError`
   - Add/Fix unit tests for the navigator, lexer, and parser
   
   Example:
   ```php
   class AsymmetricVisibilityClass {
       // Constructor Property Promotion
       public function __construct(
           public(set) string $field1, // implicit public
           public private(set) int $field2,
           public protected(set) readonly int $field3,
       ) {}
   
       // valid fields
       public(set) string $example1; // implicit public
       public private(set) int $example2 = 1;
       public protected(set) readonly int $example3;
       final private private(set) readonly string|int $example4; // final is 
available as of PHP 8.4
   
       // invalid cases but the parser doesn't handle them as errors
       // e.g.
       public public string $invalid1 = "invalid"; // multiple same modifiers
       final private private(set) string|int $invalid2; // cannot use both 
final and private
       public public(set) $invalid3; // need type
       private public(set) string $invalid4; // visibility(private) must not be 
weaker than set visibility
   }
   ```
   
   PHP 8.4
   
   
![nb-php84-asymmetric-visibility-php84](https://github.com/user-attachments/assets/46b9acad-4627-414c-805a-23f643810612)
   
   
![nb-php84-final-property-php84](https://github.com/user-attachments/assets/deb06d36-9212-48e6-80e6-77c243d0392f)
   
   PHP 8.3
   
   
![nb-php84-asymmetric-visibility-php83](https://github.com/user-attachments/assets/3fd35c89-84ae-4bb8-a4d0-477781065a2c)
   
   
![nb-php84-final-property-php83](https://github.com/user-attachments/assets/b640b636-ac47-4674-ada7-6dc34154fd5f)
   
   Navigator
   
   
![nb-php84-asymmetric-visibility-constructor-property-promotion-navi](https://github.com/user-attachments/assets/7bdf51a1-6ac2-49fe-81c2-939ca85dc511)
   
   ### PHP 8.4 Support: Asymmetric Visibility v2 (Part 2)
   
   - Fix `ModifiersCheckHintError`
   - Move final modifier errors from the `FinalModifierHintError` to 
`ModifiersCheckHintError`
   - Add useful methods to the `PhpVersion`
     - `hasFinalConst()`
     - `hasDeprecatedAttribute()`
     - `hasFinalField()`
     - `hasAsymmetricVisibility()`
   - Add methods and constants for set visibility to the `PhpModifiers`
   - Add unit tests for hints
   - Increment spec vesions
   
   
![nb-php84-asymmetric-visibility-hint1](https://github.com/user-attachments/assets/7a6147c4-91d5-47aa-a7e1-e964ccb47821)
   
   
![nb-php84-asymmetric-visibility-hint2](https://github.com/user-attachments/assets/ac5fc1f6-a254-48dc-9112-d15bfa2ac4ae)
   
   ### PHP 8.4 Support: Asymmetric Visibility v2 (Part 3)
   
   - Fix hints
     - `IncorrectConstructorPropertyPromotionHintError`
     - `UnusedVariableHint`
   - Add/Fix unit tests
   
   ### PHP 8.4 Support: Asymmetric Visibility v2 (Part 4)
   
   - Fix Code Completion
   - Fix/Add unit tests
   
   Note: CC does not work correctly on the following caret position because set 
visibility keywords contain a brace.
   ```php
   class Example {
       public private(se^ // ^: caret
   }
   ```
   
   ### PHP 8.4 Support: Asymmetric Visibility v2 (Part 5)
   
   - Add unit tests for formatter
     - set visibility (`private(set) int $i;`)
     - final property (`final public string $s = "string";`)


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