-
Notifications
You must be signed in to change notification settings - Fork 866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP features for NB21 #6819
Merged
Merged
PHP features for NB21 #6819
Conversation
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
- #4725 - https://wiki.php.net/rfc/dnf_types - Fix DNF return types for the navigator
- #4725 - https://wiki.php.net/rfc/dnf_types - Fix DNF parameter types for the navigator - The following cases are incorrect syntax for `@method` tag ``` @method int i() i($a = array()) Comment 10 ``` - See: https://docs.phpdoc.org/3.0/guide/references/phpdoc/tags/method.html#method - So, disable `PHPCodeCompletion201870Test` and `PHPCodeCompletion203294Test`
- #4725 - https://wiki.php.net/rfc/dnf_types - Fix DNF field types for the navigator
- #4725 - https://wiki.php.net/rfc/dnf_types - Fix code completion for return, field, `@method`, `@property`, and `@var` DNF types - Fix the lexer to recognize DNF types of vardoc (`/** @var X|(Y&Z) $var */`) - Add unit tests
- #4725 - https://wiki.php.net/rfc/dnf_types - Fix code completion for parameter DNF types - Add unit tests
- #4725 - https://wiki.php.net/rfc/dnf_types - Fix documentation of code completion for parameter DNF types - Add unit tests - Increment the spec version to 2.27.0
- #4725 - https://wiki.php.net/rfc/dnf_types - Fix the formatter(Prevent adding `WHITESPACE_BEFORE_METHOD_DEC_PAREN` twice) ```php // e.g. the following case has "((" function example((X&Y)|Z $param): void {} ``` - Add a unit test
- #4725 - https://wiki.php.net/rfc/dnf_types - Fix the code completion, the code generator, and the `ImplementAbstractMethodsHintError` for overriding/implementing methods - Add unit tests
- #4725 - https://wiki.php.net/rfc/dnf_types - Fix the mark occurrences and the go to declaration features - Add unit tests
- #4725 - https://wiki.php.net/rfc/dnf_types - Add unit tests for the `InitializeFieldsSuggestion`
PHP 8.2 Support: Disjunctive Normal Form Types #4725
PHP 8.2 Support: Disjunctive Normal Form Types #4725
- #4725 - https://wiki.php.net/rfc/constants_in_traits - Add the `hasConstantsInTraits()` method to `PhpVersion` - Fix `ConstantRedeclarationHintError` and `IntroduceSuggestion` - Add unit tests - Increment spec versions
- PhpDoc may have separators(":") - e.g. `@param (callable(CacheItemInterface,bool):T)|(callable(ItemInterface,bool):T)|CallbackInterface<T>` - Fix/Add unit tests
PHP 8.2 Support: Constants in Traits #4725
…urn_type PHP: Implemented correct return type guessing for a function that returns an array
- #6706 - We can get "[" as PHP_ENCAPSED_AND_WHITESPACE token e.g. `$x = "[$y example]";` - So, check also token ids - Add unit tests
…acket Handle brackets other than string correctly when "]" is typed #6706
Fix the formatting for a method invocation with a ternary or null-coalescing operator #5380
- #6731 - When a multi-line parameter of a function/method invocation has a string with a variable(e.g. `"example {$example}"`), ignore the variable within the string(i.e. {$example}) to avoid adding extra indentations Example: ```php $x = test( "test {$test}" );// enter key here ``` Before: ```php $x = test( "test {$test}" ); // one indentation is added ``` After: ```php $x = test( "test {$test}" ); // no indentation ```
Fix incorrect indentation behavior #6731
…decl PHP: Improve the performance for Go to Declaration
- #6701 - https://wiki.php.net/rfc/dynamic_class_constant_fetch - Fix the grammar file (parser) - Add the `PHP83UnhandledError` - Add/Fix unit tests for the parser Example: ```php class Example { const CONSTANT = 'constant'; } $constant = 'CONSTANT'; echo Example::{$constant}; ```
- #6701 - https://wiki.php.net/rfc/dynamic_class_constant_fetch - Fix the `SemanticAnalysis` - Fix the mark occurrences and the go to declaration features - Add unit tests
- #6701 - https://wiki.php.net/rfc/dynamic_class_constant_fetch - Fix the formatter - Add the option of the around spaces for the scope resolution operator (`::`) - Don't add spaces within braces (`{}`) e.g. {$example} - Add unit tests
- #6701 - https://wiki.php.net/rfc/dynamic_class_constant_fetch - Fix the code completion feature - Add unit tests for the code completion and brace matching features
- #6701 - https://wiki.php.net/rfc/dynamic_class_constant_fetch - Fix the `IntroduceSuggestion` and `PHP55UnhandledError` - Add unit tests
…fetch PHP 8.3 Support: Dynamic class constant fetch #6701
- #6701 - https://wiki.php.net/rfc/typed_class_constants - Fix the grammar file (parser) - Fix the `PHP83UnhandledError` - Add/Fix unit tests for the parser - Increment the spec version Example: ```php class Example { public const string CONSTANT1 = 'constant'; public const ?int CONSTANT2 = 1; public const int|string CONSTANT3 = 1; } ```
- #6701 - https://wiki.php.net/rfc/typed_class_constants - Index class constant types - Fix the navigator - Add/Fix unit tests for the indexer and the navigator - Increment the spec version
- #6701 - https://wiki.php.net/rfc/typed_class_constants - Fix the context sensitive lexer (Reserved keywords can be used as constant names) - Get the constant names as the `PHP_STRING` token - Add unit tests Example: ```php class Example { public const string|array array = [1, 2, 3], string = "example"; } ```
- #6701 - https://wiki.php.net/rfc/typed_class_constants - Fix the mark occurences and the go to declaration features - Add unit tests
- #6701 - https://wiki.php.net/rfc/typed_class_constants - Fix the Code Completion feature - Add templates for constant statements - Add unit tests
- #6701 - https://wiki.php.net/rfc/typed_class_constants - Fix the formatter (don't add spaces within parens of DNF types) - Fix the `UnusableTypeHintError` - Add unit tests
PHP 8.3 Support: Typed class constants #6701
tmysik
approved these changes
Dec 8, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These already have been reviewed.