forked from apache/netbeans
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PHP 8.4 Support: Property hooks (Part 1)
- apache#8035 - https://wiki.php.net/rfc#php_84 - https://wiki.php.net/rfc/property-hooks - Fix the lexer and parser(grammar) - Add `PropertyHookDeclaration` as an `ASTNode` - Fix `PHP5ErrorHandlerImpl` (handle missing tokens) - Fix/Add unit tests for the lexer and parser - Remove `ArrayDimensionSyntaxSuggestionHint` because this no longer works. Example: ```php class PropertyHooksClass { public int $backed = 100 { get { return $this->backed; } set { $this->backed = $value; } } public $doubleArrow { // virtual get => $this->test(); set => $this->test() . $value; } public $attributes { #[Attr1] get {} #[Attr2] set ($value) { $this->attributes = $value; } } public $reference { &get => $this->reference; } public $final { final get => $this->final; } // constructor property promotion public function __construct( public $prop { get { return $this->prop; } set { $this->prop = $value; } } ) {} } class Child extends PropertyHooksClass { public $prop { get => parent::$prop::get(); set { parent::$prop::set($value); } } } interface PropertyHooksInterface { public string $prop1 { get; } final public int $prop2 { set; } public $prop3 { get; set; } public $ref { &get; } } ``` Note: Curly braces array access (`{}` e.g. `$array{1}`, `$array{'key'}`) can use no longer. Because a conflict occurs in the following case: ```php "string"{1}; public string $prop = "string" { get => $this->prop; set {} } ```
- Loading branch information
Showing
211 changed files
with
78,435 additions
and
65,686 deletions.
There are no files selected for viewing
2,159 changes: 1,092 additions & 1,067 deletions
2,159
php/php.editor/src/org/netbeans/modules/php/editor/lexer/PHP5ColoringLexer.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6,991 changes: 3,694 additions & 3,297 deletions
6,991
php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Parser.java
Large diffs are not rendered by default.
Oops, something went wrong.
2,149 changes: 1,088 additions & 1,061 deletions
2,149
php/php.editor/src/org/netbeans/modules/php/editor/parser/ASTPHP5Scanner.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5,464 changes: 2,732 additions & 2,732 deletions
5,464
php/php.editor/src/org/netbeans/modules/php/editor/parser/EncodedActionTable1.java
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.