intelephense
Version:
A PHP language server
875 lines (720 loc) • 92.1 kB
Markdown
# Change Log
## [1.18.4 - 2026-05-26]
#### Fixed
- Conditional types with parameter subject resolving to incorrect type.
## [1.18.3 - 2026-05-17]
#### Fixed
- False only variable can be passed by ref error with `extract`.
- Undefined variable diagnostics not showing within closures in script scope when `intelephense.diagnostics.undefinedVariables` is set to `local`.
- Parse error when encountering DNF type after readonly promoted prop modifier.
- Parameter highlight not working in closures.
- If parameter rename text does not start with `$` it should be automatically prepended.
- `completion.withMethodBody` setting not working for implement all abstract functions code action.
- Incorrect resolution of conditional type when subject type is `mixed`.
- Go to definition not working for callable arrays when first element is a variable reference.
- Imports not counted as reference in reference code lens.
- Hovering over `@property` property name showing type as `unset`.
## [1.18.2 - 2026-05-02]
#### Fixed
- False array key type error when array is initially empty.
- False duplicate trait in use list when multiple traits in same file use same trait.
- False trait method collision when trait method is identical but inherited by different pathways.
- False unused property error when trait declares property and composing class declares the property as a promoted property.
- Make `instanceof` work with `class-string<T>`.
## [1.18.1 - 2026-05-01]
#### Changed
- Suppress undefined member diagnostics in traits when scope is `$this` and every type that uses the trait implements the member.
- The `intelephense.diagnostics.undefinedVariables` setting has changed from a boolean to an enum of `'on'|'local'|'off'`. Defaults to `'on'`. When set to `'local'` only local scope undefined variables diagnostics will be emitted. **BREAKING**
- The `intelephense.diagnostics.argumentCount` setting has changed from a boolean to an enum of `'on'|'declared'|'off'`. Defaults to `'on'`. When set to `'declared'` only declared functions/method argument count diagnostics will be emitted. That is, annotated `@method` methods will be ignored. **BREAKING**
- `P1132 No type information available` diagnostics will no longer show for properties with an initialiser or for parameters with a default argument.
- `P1119 Too many argument` errors will no longer show for functions that call `func_get_args`.
#### Fixed
- Document symbols broken when using a namespace definition with a body.
- `#[Override]` inserted in wrong spot for method override completion if method modifiers and or `function` keyword already present.
- False key type errors when using array access notation on `ArrayAccess` implementations.
- PHPDoc parse error on `list{a, b}`.
- Variable type narrowed to never if RHS of `instanceof` is a variable of type `class-string`.
- False dead code diagnostic when switch case expression is `false` constant.
- Template types not resolving inside methods that inherit template documentation from ancestors in type hierarchy.
## [1.18.0 - 2026-04-28]
#### Added
- Ability to provide configuration via a JSON file named `intelephense.config.json` when client does not support LSP `workspace.configuration`. Top level `intelephense` property is unnecessary. File must be a direct child of workspace folder. JSON `configuration` schema can be found at https://github.com/bmewburn/vscode-intelephense/blob/master/package.json.
#### Changed
- Updated stubs.
#### Fixed
- Diagnostics not refreshing when `diagnostics.exclude` edited.
- Some `*.exclude` properties not working on basename when non-path glob provided.
- Race condition between getting configuration and opening documents causing settings to be ignored. Documents will now be opened regardless, and then closed if they should not have been opened due to `files.maxSize`, `files.associations` or `files.exclude` settings once they are fetched.
## [1.17.7 - 2026-04-20]
#### Fixed
- `require` document links not working when the expression is a simple string literal.
## [1.17.6 - 2026-04-19]
#### Changed
- Indexing now uses LSP work done `$/progress` notifications instead of custom notifications.
- Indexer file queue processing debounce increased to 500ms.
- On-type diagnostics debounce reduced to 1000ms.
#### Fixed
- Empty array shapes showing parse error.
- Should not narrow variable type when using `is_a` and `is_subclass_of` with `$allow_string` value of `true` and variable type of `string`.
- Editing a file causing promoted properties to become undefined.
- Editing a file causing definition location inaccuracies.
- Duplicate/unecessary indexing when responding to file change events.
- Editing a file causing anonymous class type hierarchy bug.
## [1.17.5 - 2026-04-08]
#### Added
- `throwDepth` setting to control maximum call depth when analysing `throw` expressions. Defaults to `0` (current call declaration body only). Max `10`. Higher values may impact performance.
#### Changed
- Methods declared with `@method` with no return type are given return type of `void` instead of `mixed`.
- `@param` type is now optional.
- Tweaked suggestion order.
#### Fixed
- False no type information available diagnostic when property/parameter inherits documented type.
- False method compatibility error when a trait method and interface method return `self`.
- `bool` subject type not expanded to `true|false` when comparing to `true` in conditional type.
- No import quickfix for undefined PHPDoc types.
- Incorrect method description shown in hover when multiple methods of same name are declared using `@method`.
- Array access type inferred as `mixed` when subject is a template type with array shape constraint.
- False undefined phpdoc type in constant unions.
## [1.17.4 - 2026-03-23]
#### Added
- More diagnostics.
- Setting `intelephense.diagnostics.suspectCode` to control whether suspected problems in the code should be reported. Diagnostics grouped under this setting include duplicate array keys, duplicate switch/match cases, loop variable overwriting, `void` assignment, assignments in control expressions.
- Find all references and rename now works for variable references listed in `compact` arguments.
- Setting to control if method override/implementation suggestions should include a placeholder method body -- `intelephense.completion.withMethodBody`. Defaults to `true`.
- Partial support for custom assertions. `@assert`, `@psalm-assert`, `@phpstan-assert` and `*-if-false` and `*-if-true` variants supported. Only type assertion of simple variable arguments is currently supported. For example `@assert string $param` and passing `$var` as the argument. Multiple assertions targeting the same parameter are not supported, ie, adding both an `*-if-true` AND `*-if-false` annotation.
#### Changed
- Method override/implementation suggestions now include `#[Override]` attribute when PHP target version is 8.3+. To disable adding this attribute set `intelephense.completion.withOverrideAttribute` to `false`.
- Improved how unused variable reporting works when `compact` is encountered.
- Improved type inference of array elements when key is a simple variable.
- Improved template type resolution for templates that appear in constraints of other templates.
- Find all implementations now works for all methods, previously it was restricted to abstract or interface declared methods.
- Find all declarations will now get the root declaration(s) in a type hierarchy regardless of whether it is an interface or abstract declaration.
- Crash telemetry now defaults to disabled.
#### Fixed
- False method compatibility error with abstract trait method and base class with final method implementation.
- Highlight not working when origin is variadic parameter in PHPDoc.
- Added back auto prefix `$` to variable renames if applicable.
- Reference/rename not working for variables in anonymous class declaration argument list.
## [1.17.3 - 2026-03-04]
#### Added
- Setting `intelephense.diagnostics.suppressUndefinedMembersWhenMagicMethodDeclared` to configure if undefined method and property diagnostics should be suppressed if magic methods are declared. Defaults to `true`.
- Setting `intelephense.diagnostics.severity` to configure the severity of each diagnostic.
- Setting `intelephense.diagnostics.strictTypes` to configure type checks to be performed as if `declare(strict_types=1)` has been declared in every file. Defaults to `false`.
- Setting `intelephense.diagnostics.exclude` to disable some or all diagnostics on a per file basis.
#### Fixed
- Various control flow analysis and type inference issues.
- PHPDoc completion missing `@throws` or showing `@throws mixed`.
## [1.17.2 - 2026-02-23] Pre-release
#### Added
- More diagnostics.
- PHP 8.5 `(void)` cast.
#### Changed
- Updated stubs.
#### Fixed
- False namespace declaration must be first statement when doc block preceedes declaration.
- False ctor cannot declare return type error for anon function.
- `class_alias` aliases not recognised if `class` constant used to declare alias name.
- Templates in `@param-closure-this` not resolved.
- False possible undefined variable after try-catch-finally block.
## [1.17.1 - 2026-02-18] Pre-release
#### Added
- More diagnostics.
#### Fixed
- Various diagnostic fixes.
- Implement all abstract methods not working for anonymous classes.
- Incorrect array creation type inference when one or more elements is a union type.
- Constant values not being computed when declared using an expression rather than a literal value.
## [1.17.0 - 2026-02-09] Pre-release
#### Added
- [Inline values provider](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_inlineValue) for better synergy with xdebug extension.
- Support for `@mixin` with an intersection type.
- Support for `value-of<T>` type.
- Support for default template type arguments eg `@template T of bool = false`.
- More diagnostics.
#### Changed
- Signature help now uses short type names instead of fully qualified type names to increase legibility.
- Variables can be now renamed to expressions, for example `$value` => `$this->value`.
- When not provided by the client, default storage will be the following:
- *nix
- storagePath - `$XDG_CONFIG_HOME/intelephense/workspace/` or `$HOME/.config/intelephense/workspace/`
- globalStoragePath - `$XDG_CONFIG_HOME/intelephense/global/` or `$HOME/.config/intelephense/global/`
- licenceKey - `$globalStoragePath/licence.txt` or `$globalStoragePath/license.txt`
- Windows
- storagePath - `%AppData%/intelephense/workspace/` or `%UserProfile%/intelephense/workspace/`
- globalStoragePath - `%AppData%/intelephense/global/` or `%UserProfile%/intelephense/global/`
- licenceKey - `$globalStoragePath/licence.txt` or `$globalStoragePath/license.txt`
#### Fixed
- Conditional type where a parameter template type is the subject yielding unexpected type when argument is a union.
- Closure `static` return type resolved too early.
- False type error when comparing an array shape to a typed array.
- Various diagnostics issues.
## [1.16.5 - 2026-02-02]
#### Fixed
- `CodeActionContext.only` being ignored for some code actions.
- Global function and constant suggestions prefixed with `\` when not configured to.
- Implementations code lens not working for hooked properties.
- Document highlight not working when origin is within phpdoc.
- Abstract hooked properties not reported as not implemented.
- PHPDoc immediately following another PHPDoc being ignored in class member lists.
## [1.16.4 - 2026-01-16]
#### Fixed
- Bad parsing of `@param` union type when followed by by-reference parameter.
- Template types not resolving to boolean literals.
- `xor` breaking language intelligence in subsequent code.
- Anonymous class methods being added as object shape properties.
- Variable hover contains `@var` information for other variables when using array destructure syntax.
- Index access types not resolved in some contexts.
- Property type being lost when there is both an annotated and declared property of the same name.
- Type alias that references another type alias not resolved fully.
- Variable types reported as `never` in `catch` blocks if there are no assignment expressions in `try` block.
- Type hinting `$this` as a union type ignored.
- Function FQSEN in `@see` not recognised.
- Dot files not being excluded even though they match an exclude glob.
- PHPDoc optional closure parameters not parsed correctly.
## [1.16.3 - 2025-12-08]
#### Fixed
- Hover not showing for methods named using a PHP reserved name or keyword.
- Type aliases not expanded after the first reference when appearing multiple times in a type.
- Global namespaced symbol suggestions not fully qualified in non-global namespace context when `insertUseDeclaration` is `false`.
- False type error when an array shape tuple is compared to a typed array.
- Template type not resolving when constraint is `key-of` another template type.
- Incorrect `ldap-Set_option` stub.
- PHPDoc that follows a trait use clause not parsed.
## [1.16.2 - 2025-11-27]
#### Fixed
- Type aliases not expanded in foreach when used as type arguments for iterators.
- Global scoped definitions showing as undefined.
- Shorthand nullable parse error in `@method` tags.
- Undefined variable when defined in previous call of call chain.
- Undefined variable when defined in `if` expression.
- Templated closure parameter showing as mixed even if a type has been declared when type arguments not supplied for scope.
- Type narrowing `$this` in traits not working.
- When both an annotated member and a declared member share the same name, visibility should be checked to select the most appropriate definition for context.
- Type constants not expanded if in type argument of another type.
## [1.16.1 - 2025-11-22]
#### Fixed
- Stack overflow when determining return type of dynamic call.
- PHPDoc with `$this` as a type not recognised.
- False cannot access member from scope diagnostics when `__call` and `__get` could be used to access non public members.
- Only the first class constant shown as completion suggestion when using comma separated declarations and PHPDoc.
- Variables declared in an array element showing as undefined in subsequent elements.
- Promoted property with setter hook showing `$value` parameter as undefined.
## [1.16.0 - 2025-11-20]
#### Added
- Initial support for PHP 8.5.
#### Changed
- Default PHP version now 8.5.
#### Fixed
- False undefined variables when declared in a `for` loop initialser and referenced in the following `for` loop initialser.
- False undefined variables when declared in an argument list and referenced in the following argument.
- Modifying a variable array type after a loop can affect the variable array element type within the loop.
- `@param-out` and `@param-closure-this` details not showing in hover.
- Hover links not wrapped in `<>` and therefore not clickable.
- Symbol outline failing if `@property` property names are missing `$` prefix.
- False type errors when assigning a generic type to a declared type which does not have type arguments.
- Omitting template type arguments causing type errors because of unresolved template.
## [1.15.3 - 2025-11-17]
#### Fixed
- Template constraints not resolving properly if constraint contains reference to another template.
- Template types not resolving properly in conditional types.
- Undefined superglobals after indexing with files open.
- `array_map` callback parameters inferred as `mixed` if they have a type declaration.
- PHPDoc leaking to subsequent statements.
- Anonymous class properties showing as undefined.
- `[]` as an `@method` parameter default value not parsed.
- `void` being included as part of union in inlay hint return type.
- Return types from duplicate methods/functions being reduced to minimal type when unioned instead of previous version behaviour of non-minimal unions.
- Property types not being inferred from constructor as a fallback when no type is declared/annotated.
- HTML/JS/CSS language features not working until edits made to the HTML/JS/CSS.
- `$this` type narrowing not working.
- Go to definition from a callable array using `__CLASS__` as the scope not working.
- Removed space at end of `<?php` suggestion.
## [1.15.2 - 2025-11-13]
#### Fixed
- Several cannot read prop of undefined and range errors.
- Incorrect suggestion for function when class of same name has been imported.
- Incorrect indentation when accepting override/implementation suggestion.
- Incorrect type inference when iterating ArrayIterator and subclasses.
- False type error, wrong type inlay hint and bad anon function suggestion when expected signature has a variadic paramter.
## [1.15.1 - 2025-11-12]
#### Fixed
- Formatting broken for mixed PHP/HTML when PHPDoc used.
- Undefined variables in functions and methods when preceeding code edited to add/remove new lines.
- `class_alias()` not working if class name argument is a string literal instead of `::class` constant.
- `@method` parsing broken for `static` methods.
- PHPDoc that follows an abstract method being ignored (causing CI4 Builder undefined methods).
- `global $argv` declaration showing undefined variable.
- Function reported as undefined when defined in an encapsulating function.
- False not all paths return value diagnostic when a custom `never` function is called.
## [1.15.0 - 2025-11-11]
#### Added
- Support for LSP `CompletionItemLabelDetails`.
- Support parsing inline comments in array shapes.
- Diagnostic when accessing members that are not visible from scope. Previously they were reported as undefined members.
- Completion suggestions for outer scope variables, with additional use clause edits, when inside anonymous functions.
- Suggestions for anonymous function signature is call argument context.
- Fallback to an appropriate type for `non-empty-mixed`.
- Support conditional types for parameters.
- `is_subclass_of` type narrowing.
- Suggestions when comparing to a variable with literal union type in switch, match, equality contexts.
- Array key suggestions when assigning sub-array to array shape.
- Setting to control font case for parameter and property name suggestions. `intelephense.completion.parameterCase` (default `camel`) and `intelephense.completion.propertyCase` (default `snake`).
- Support for `@param-closure-this`.
- Support for `@param-out`.
- Support relative links in PHPDoc. Relative URIs wil be resolved to an absolute URI relative to the current file. URIs without any `.` or `..` prefix will be resolved relative to the workspace folder.
- Added completion suggestions relative to existing partial use declarations. Must be enabled with `intelephense.completion.suggestRelativeToPartialUseDeclaration`. The setting value is the maximum number of namespace segments which can appear in the suggested edit. Defaults to `0` (disabled).
- Support for `MyClass::*` wildcard and non-wildcard syntax for class constant union types in PHPDoc.
- Support for constants in PHPDoc union types. Constants must be UPPERCASE and must be fully qualified to avoid name resolution ambiguities with object types.
- Auto-closing of short tag echo (`<?=`). Can be turned off with `intelephense.shortOpenEchoAutoClose`. VSCode only.
- Support for inlay hints. Hints are shown for call declaration return types, anonymous function parameter types, and call argument parameter names. Can be turned off with `intelephense.inlayHint.returnTypes`, `intelephense.inlayHint.parameterTypes`, and `intelephense.inlayHint.parameterNames` respectively. **[Premium](https://intelephense.com)**
- Visiblity modifiers are now shown in outline.
- Support for `SignatureHelp.activeSignature`.
- Suggest variable names in `compact`.
- Support for `class_alias`.
- Added a document link provider to navigate on click to required/included files. **[Premium](https://intelephense.com)**
#### Changed
- Removed workspace file limitation. Larger workspaces will consume more resources.
- Suggest trait names in all contexts not just in `use` clauses.
- Type, function, constant suggestions now use contiguous substring searching.
- Modified suggestion sort order via sortText property to improve suggestion order 🤞.
- Now more tolerant of FQSENs that aren't fully qualified in `@see`, `@uses`.
- Override suggestions are now shown without having to first qualify the context with a visibility modifier or `function`.
- Improved Workspace symbol search. Search now uses contiguous substring matching. For example `mfc` would find `my_function`. Searching can also be done using the fully qualified structural element name (FQSEN) (or part there-of) of the symbol. This can narrow down the type of symbol as well. For example `mc:f(` would find the method `MyClass::foo()`.
- Updated and improved various stubs.
- For performance reasons, only named function call expressions will be analysed for `never` return types (eg `dd()`). Previously, all call expressions were analysed. A workaround for this limitation is to use the patterns `return $foo->never();` or `$test || throw $foo->never()` to declare that the path exits. **! BREAKING !**
- Method override/implementation suggestions now include a parent call and not implemented throw respectively.
#### Fixed
- Renaming a constant reference not renaming the declaration.
- Type suggestions following `@method static`.
- Template with union type restriction not inferred properly.
- Type aliases not resolved in some contexts.
- Inline `@see` not hiding url when description provided.
- Statement keyword suggestions not appearing for control structures without braces.
- PHPDoc not formatted correctly above enum cases.
- Type inference inconsistent with `ArrayAccess` and subtypes.
- Keyword suggestions missing in switch expression.
- `readonly` on anonymous class causing parse error.
- Array key suggestions not showing in constructor calls.
- False method signature not compatible diagnostics.
- Various control flow analysis issues within loops.
- Not warning on unused private promoted properties.
- Incorrect Generator type arguments when exiting before yield.
- Incorrect diagnostic message when `readonly` used with property hook.
- Using `self` in call signature in traits doesn't resolve to exhibiting class.
- Intersected object types not producing intersected type for property.
- False type errors for PHP math extensions that have operator overloading.
- Magic method implementation suggestions produce invalid code if abstract modifier is present.
- Smart select bugged if selecting at end of a file that doesn't end in an empty line.
- Some stub symbols being excluded, resulting in undefined symbol errors, when the symbol has a phpdoc with no tags.
## [1.14.4 - 2025-04-01]
#### Fixed
- Completion suggestions not showing in phpdoc.
- False not all paths return value error when returning result of void returning function call.
- False calling non-static method statically for parent property hook calls.
- String literals where the value is a namespaced class not resolved to class when passed to `class-string<T>`.
- Trait `self` not resolved to exhibiting class when used as a type argument for templated class.
- False return type error when using templates and returning `static`.
- DocBlock indent should be inline with following switch case/default statement.
- False unused import when used in typedef annotation.
- No `$this` suggestion inside anonymous function defined within a type definition.
- Typedef types not expanded when appearing in passed by-ref parameters.
- Spurious undefined methods/function diagnostics appearing after indexing workspace.
#### Fixed
- Completion suggestions inside of PhpDoc have incorrect replace range.
- Remove default stub entries that no longer exist.
## [1.14.3 - 2025-03-05]
#### Fixed
- Spurious parser errors when editing adjacent to `if` or `try` blocks.
## [1.14.2 - 2025-03-01]
#### Fixed
- Spurious parser errors when editing mixed html/php containing short echo tags.
- False not all paths return a value with try/finally.
- False method compatibility error when overriding a method with optional parameters with a method with a variadic parameter.
## [1.14.1 - 2025-02-28]
#### Fixed
- RangeError invalid array length.
## [1.14.0 - 2025-02-28]
#### Added
- Templated definitions for `array_find`, `array_find_key`, `array_any`, `array_all`, `uasort`, `uksort`, `array_walk`, `array_walk_recursive`.
- Array shape key completion suggestions in return statement, function/method argument, destructuring contexts.
- `default` added to keyword completion suggestions in match expr.
- Property declaration name suggestions generated from type declaration and from base class.
- Support insert and replace completion suggestion ranges.
- Completion suggestion for type definition name based on file name.
- Completion suggestion for namespace based on file and composer.json.
#### Changed
- Updated stubs
- PHPDoc for variadic params where the ellipsis (`...`) has been omitted and the type is an array are now considered to describe the type of the parameter within the function body, not the type being passed to the function.
- Passing names of PHP non-object built-in types (eg `string`, `int`) to a function that expects `class-string<T>` now resolves `T` to that built-in type instead of a user class with that name.
- Expanded variety of parameter declaration name suggestions to include snake case and shorter name variations.
#### Fixed
- Cannot `@disregard` diagnostics on property declarations.
- Return type diagnostics in traits.
- False return type error in generator.
- Property type inference when redundant `SubClass|SuperClass` scope types encountered.
- Type narrowing with null coalesce assignment in conditional expression.
- False type error when assigning `$this` to property.
- Array type lost when assigning empty array to multidimensional array element.
- False unused method diagnostic when method called in `$this instanceof` conditional block.
- `list<>` key should be `int` not `int|string`.
- False method compatibility error when override declares variadic parameter.
- Range format provider should format token and leading trivia if only leading trivia falls in range.
- Named argument completion suggestions should not be case sensitive.
- Should consider composer.json autoload-dev when generating file renames.
## [1.13.1 - 2024-12-30] Pre-release
#### Fixed
- False parse errors when editing open tags and `intelephense.environment.shortOpenTag` is enabled.
- Default PHP version should be 8.4.
- Missing `frakenphp` from stubs enum.
- False implicit nullable parameter diagnostic when type is `mixed`.
- False abstract not allowed error for PHP8.4 abstract properties.
- Union of `Traversable` and empty array losing traversable template type.
## [1.13.0 - 2024-12-17] Pre-release
#### Added
- PHP 8.4 class member access on instantiation without parentheses.
- PHP 8.4 property hooks.
- PHP 8.4 asymmetric visibility.
- PHP 8.4 Deprecated diagnostic for implict nullable parameters.
- Support `@mixin` template types. This improves type inference when using Laravel 11.
- `intelephense.diagnostics.memberAccess` setting that controls whether to show diagnostics relating to member access. Defaults to `true`.
#### Changed
- Default PHP version now 8.4.
- Updated stubs.
- Parent and Overrides code lens no longer shown above methods that have no parent or overrides to reduce clutter.
#### Fixed
- Crash when parsing phpdoc with conditional type containing newlines.
- `Traversable` not treated as covariant to `iterable`.
- Incorrect types for some `$_SERVER` elements.
- Enums not recognised as implementations of interfaces.
- Incorrect parse error for empty heredoc.
- Type not narrowed when using nullsafe operator.
- Template types not resolved for `__invoke`.
- Go to type definition not working for foreach value.
- Incorrect formatting of comments above `default` in match expression.
- False method signature diagnostics when using older versions of PHP.
- Variable type incorrectly inferred as `never` inside while loops with logical conditional expression.
- False readonly property error when initialising trait declared property in exhibiting class.
- Bad range formatting when selecting part of a multiline call chain.
- Template types not resolved when passing `Iterator` to `iterable` constraint.
## [1.12.6 - 2024-09-09]
#### Fixed
- Template types incorrect when implementing `Iterator`.
- `Traverable` template types lost.
- `assert` not working when fully qualified.
- False `unset` variables after logical expression when using `or` operator.
- No completion suggestions for variables declared in array destructure.
- Don't reduce function return types to minimal type as eagerly.
- False unused symbol diagnostic for promoted property with no visibility modifier.
## [1.12.5 - 2024-08-29]
#### Fixed
- Performance issue with large arrays. Array shapes are now only generated internally on arrays with 20 or less elements.
- Go to type definition not working when origin is an assignment expression.
- Type lost when built in constants `true`, `false`, and `null` are prefixed with backslash.
- `static` as a template type argument resolving to wrong type.
- False method signature compatibility errors for built-in PHP symbols when targeting PHP versions < 8.1.
- Incorrect and cut-off completion suggestions when triggered by `use` inside a top level anonymous function.
- Don't eagerly reduce unions when substituting templated types.
- False return type error diagnostics when calling templated parent methods.
## [1.12.4 - 2024-08-19]
#### Fixed
- Parameter type showing `unset` for anonymous functions declared within an unpacked array.
- Callable signatures with `static` typed parameter losing template type args.
- Parameter type showing `unset` for anonymous functions declared within an anonymous class header.
- Licence key not syncing across machines in VSCode.
## [1.12.3 - 2024-08-13]
#### Fixed
- Hover, go to definition not working on phpdoc `@see` FQSEN.
- Callable signatures with `static` typed parameter resolving to incorrect type.
- Type inference within `for` statements with no control expression.
- Should not do additional type checks on variables that have `unset` type.
- Variables with type `null` not taking on by ref parameter type when passed as argument.
- Anonymous function parameters showing as undefined when function declared inside array.
- Variables assigned to in `try` block have type `unset` in `catch` clause.
## [1.12.2 - 2024-08-08]
#### Fixed
- TypeError: Cannot read properties of undefined (reading 'scopeTypeDefinition')
## [1.12.1 - 2024-08-08]
No changes. Version bump to keep in sync with vscode-intelephense
## [1.12.0 - 2024-08-08]
#### Added
- Code lens for references, abstract/interface implementations, trait usages, method overrides, method parent. Code lenses are disabled by default and can be enabled by setting the `intelephense.codeLens.references.enable`, `intelephense.codeLens.implementations.enable`, `intelephense.codeLens.usages.enable`, `intelephense.codeLens.overrides.enable`, `intelephense.codeLens.parent.enable` settings to `true` respectively.
- Find all references for `__construct`.
- Object shape property hover.
#### Changed
- Built in array function stubs now have templated definitions.
- Improved DOMNodeList::getIterator stub
#### Fixed
- Comparing class-string in conditional return yielding incorrect type when subject is subtype of test type.
- No type inference and false undefined property when accessing property of intersection type with object shape component.
- `@internal` annotation missing description in hover.
## [1.11.8 - 2024-08-01]
#### Fixed
- Lost variable types after `xor` expr;
## [1.11.7 - 2024-07-30]
#### Changed
- Reducing to minimal union types is now less eager.
#### Fixed
- False undefined class constant in unreachable code.
- Cannot read properties of undefined (reading 'length') intelephense.js:2:2322561
## [1.11.6 - 2024-07-29]
#### Added
- Handle phpstan call site variance syntax.
#### Changed
- Template types and metadata return types will no longer resolve to an argument type of `never` in order to prevent code being unintentionally marked unreachable following function/method calls.
- Undefined property diagnostic now suppressed in `isset`, `empty`, `unset`, LHS of null coalesce to match PHP behaviour.
- Type check of LHS of property access expression suppressed in `isset`, `empty`, `unset`, LHS of null coalesce to match PHP behaviour.
#### Fixed
- `float` parameter should permit `int` as argument.
- Type inference with `null` equality comparison.
- Undefined variables not diagnosed inside closure.
- False undefined method diagnostics with templated parameters.
- Auto import function adding unnecessary `function` keyword when in group use list.
- Variable type becoming mixed when passed by ref in closure use clause.
- Circular reference problem when trait has `@mixin` of the same class that exhibits it.
- False argument count error when trait provides implementation for an interface and gives params default args.
- Unable to override variable type with `@var` if RHS of assignment contains closure.
## [1.11.5 - 2024-07-07]
#### Fixed
- Various control flow analysis issues.
- Performance and type inference issues with array read/writes.
- Type inference following `yield` expression.
- False type error when unpacking templated type.
## [1.11.4 - 2024-07-04]
#### Fixed
- Invalid Argument Error e.toLspSymbolKind lib/intelephense.js:2:3058335
## [1.11.3 - 2024-07-04]
#### Fixed
- Laravel eloquent builder queries losing model type.
- Template mapping between class with a base class method.
- Cannot read properties of undefined (reading 'length') when encountering attributed property declared with `var`.
## [1.11.2 - 2024-07-03]
#### Fixed
- Type inference for properties with default initialisers.
- Performance degradation in code with many array read and writes.
- False undefined variable after `while` loop with condition expression that resolves to `true` literal type.
- Stack overflow when applying large text edits.
## [1.11.1 - 2024-07-02]
#### Changed
- When a trait has an annotated or abstract method and the real method definition is supplied by a base class, then go to definition will now go to the base class definition instead of the trait method declaration.
- Go to implementations now includes implementations provided by a trait where a class both uses the trait and implements the interface.
#### Fixed
- False diagnostic when type `class-string` passed to `string` constraint.
- Setting `completion.suggestObjectOperatorStaticMethods` should be `intelephense.completion.suggestObjectOperatorStaticMethods`.
- Crash when parsing incomplete phpdoc type with template type args.
- Crash when encountering `trigger_error` call with `E_USER_ERROR` as argument.
- Conditional return types with default parameter argument.
## [1.11.0 - 2024-06-29]
#### Added
- Type Hierarchy. **[Premium](https://intelephense.com)**
- Support for `key-of<Type>` utility type.
- Support for `T[K]` index access utility types.
- Completion suggestions for `$_SERVER` array keys.
- `unset()` now set variable type to `unset`.
- Phpdoc unsealed array shape syntax - `array{foo: 'bar', ...<int, object>}`.
- Support PHP 8.3 enum and class constant dynamic access syntax.
- Ability to turn formatter off/on with comments. Within PHP - `// @formatter:off`, `// @formatter:on`. Within HTML - `<!-- @formatter:off -->`. Within js/CSS - `/* @formatter:off */`.
- New setting to prefer `@psalm-`, `@phpstan-` prefixed annotations when determining symbol type. Defaults to `false`. `intelephense.compatibility.preferPsalmPhpstanPrefixedAnnotations`.
- Support for `@psalm-type` and `@psalm-import-type` type aliases. Set `intelephense.compatibility.preferPsalmPhpstanPrefixedAnnotations` to `true` to enable.
- Support `@see`, `@uses`, `@link` annotations and inline variants.
- Static member access completion/hover/references when scope is variable of type `class-string<Foo>`.
- Hover on array shape string keys.
- New `intelephense.diagnostics.relaxedTypeCheck` setting. Defaults to `true` (previous version behaviour). This setting makes type checking less thorough by allowing contravariant (wider) types to also satisfy a type constraint. This is useful for projects that may have incomplete or innacurate typings. Set to `false` for more thorough type checks. When this setting is `true`, the `noMixedTypeCheck` setting is ignored.
- New `intelephense.diagnostics.noMixedTypeCheck` setting. Defaults to `true` (previous version behaviour). This setting turns off type checking for the `mixed` type. This is useful for projects that may have incomplete or innacurate typings. Set to `false` to make type checking more thorough by not allowing `mixed` to satisy any type constraint. This setting has no effect when `relaxedTypeCheck` is `true`.
- New `intelephense.completion.suggestObjectOperatorStaticMethods` setting. PHP permits the calling of static methods using the object operator eg `$obj->myStaticMethod();`. If you would prefer not to have static methods suggested in this context then set this value to `false`. Defaults to `true`.
- Parameter types are now injected into inline closure arguments to functions from the corresponding parameter annotated callable type. For example declaring `function doCallback($myCallback) {}` with annotation `/** @param \Closure(Foo $param): void $myCallback **/` will result in type hints for `$param` inside `doCallback(function ($param) { /* $param type is known */ });`
- Support `@var` annotated type above `define` constants.
#### Changed
- Minimum VSCode version 1.82.
- Recommended nodejs version 20.
- Literal types and array shapes are now used for constants. eg the type of `const FOO = 'bar';` is now `'bar'` instead of `string`, `const ARR = ['foo' => true]` is now `array{foo: true}` instead of `array`.
- `$argv` is now type `string[]`.
- `$http_response_header` is now type `array|unset`.
- `$php_errmsg` is now type `string|unset`.
- Updated stubs.
- Formatter now aims to be [PER](https://www.php-fig.org/per/coding-style/) compliant. As such, `psr12` setting in `intelephense.format.braces` has been removed and `per` added.
- Formatter now allows a single space or no space in unary logical negation.
- Empty class, trait, interface, enum, function, method bodies are formatted to `{}` with a single space preceeding `{`.
- Short anonymous functions are now formatted to have no space between `fn` and `(`.
- Improved multiline `foreach` expression formatting.
- Formatter now allows a single space or no space before colon in alternate control statements.
- Formatter now allows a single space or newline + indent before opening brace in anonymous class.
- Formatter now allows semicolon to be placed on a separate line in multiline chained expression statements.
- Multiline arrays are now formatted to a single element per line.
- Formatter will preserve wrapped attibutes in HTML.
- When multiple method/function candidates are found for a call expression, the result will be a union of the return types of the functions/methods.
#### Fixed
- Template type resolution from args when arg is subtype of param type.
- Various control flow fixes and improvements.
- Missing or poorly displayed code blocks in hover/completion documentation for some built-in symbols.
- Array destructure with skipped elements.
- Shorthand ternary type inference.
- Incorrect import folding range.
- Param with optional array shape element not indicating element is optional when hovering.
- Hover on named arg of closure showing incorrect type `unset`.
- Incorrect type inferred for dynamic object creation expression when dynamic type is union.
- Hover showing non php fenced codeblocks incorrectly.
- Stack overflow with deeply nested string concatenation (TYPO3 PackageArtifact.php).
- Incorrect return type for symbols with metadata and null default parameter value (Laravel `app()`);
- Incorrect type when generating phpdoc for variadic params.
- Declare statement should accept comma separated directive list.
- Incorrect `$matches` type after `preg_match_all` call.
- Promoted property highlight.
- Code actions not showing when narrow or zero length range provided.
- Unable to `@disregard` errors in method header.
- Unnecessary match expr format when operand of binary expr.
- Incorrect file rename if `composer.json` contains autoload paths without trailing `/`.
- `static::class` resolving to parent class name rather than child class name.
- Trait method `self` return type not resolving to consuming class when used as implementation for interface method.
- Don't show `iterable` as interface.
- Variables typed as `iterable<Foo>` not working with array access notation.
- Array destructure with `ArrayAccess`.
## [1.10.4 - 2024-03-26]
#### Fixed
- Cannot read properties of undefined (reading kind) with `for` loops which have parse errors.
## [1.10.3 - 2024-03-25]
#### Fixed
- Incorrect return type when using null safe operator.
- False undefined variable error in 3rd `for` control expression.
- Incorrect return type for traits with method templates.
- False return type error when method returns method or class template type.
- Subclass constructor should not inherit phpdoc from superclass constructor.
- Conditional return types when testing parameter in namespaced file.
- False unknown named argument diagnostic with closures.
- Formatter adding extra space in method call where method named `catch`.
- Nested heredoc parsing.
- False unknown named argument diagnostic with trait method aliases.
- Metadata overrides when named args are used.
- Various version dependent stub type problems.
- Array callback references not being found.
- Type inference for const symbols with `new` object initialisers.
- Type inference in switch/match with instanceof.
- Trait template mapping when phpdoc provided above trait use declaration.
- Object creation expression with variable returning `object` when more specific type could be inferred.
- False method compatibility diagnostic with base class that has a trait method alias.
- False method not implemented diagnostics when enum implements interface that extends BackedEnum.
## [1.10.2 - 2023-12-10]
#### Fixed
- Crash when `self` not used inside class.
- False cannot use parent in class with no parent diagnostics.
- Undefined class not reported when using `ClassName::class`.
- Type inference when destructuring array shape with numeric or no keys.
## [1.10.1 - 2023-11-13]
#### Fixed
- Return types of some stubs
- False error when array or object shape passed to function expecting array or object.
- Array destructure of numeric indexed array shape.
- False error when using argument unpacking.
- False error when using array unpack on an array shape.
- Crash when parsing malformed or unsupported conditional return type syntax.
- Format only providing edit to remove closing tag even though other edits are applicable.
- Method template resolution when method comes from `@mixin` class.
- Expected pattern to be a non-empty string crash.
- Declare correct min vscode version - 1.79
## [1.10.0 - 2023-11-05]
#### Added
- PHP 8.3 support
- Array/Object shapes via annotations. For example - `/** @param array{foo:string, bar:int} $arrayShape */`, `/** @return object{foo:string, bar:int} */`.
- Improved type inference for `new $className` expressions where `$className` is of type `class-string`.
- Annotation to ignore diagnostics/problems on statement level: `/** @disregard [OPTIONAL CODE] [OPTIONAL DESCRIPTION] */`. For example `/** @disregard P1013 method exists on runtime type */`.
- Conditional return types. Must be encapsulated in parentheses. For example - `/** @return ($param is string ? string : object) */`, `/** @return (T is string ? string : object) */`
#### Changed
- Updated stubs.
- Updated dependencies.
- Problem/diagnostic codes are now strings, with the previous codes prefixed with 'P'.
- Properties with a declared or annotated type are now only narrowed on assignment to a subset of the declared/annotated type.
#### Fixed
- Auto indexing on composer install/update
- Signature help showing no parameters when there are multiple definitions in workspace.
- Type lost when null coalescing with empty array.
- Wrong type when bitwise expr operands are both strings.
- PhpDoc being applied to consecutive symbol declarations when used with enum case.
- Property attributes not suggested on constructor promoted properties.
- `class-string<T>|T` type resolution.
- Method definitions not found for method string in callable array function arguments when multiple definitions of class/method are in workspace.
- Methods marked as undefined when packages provide ide helper stubs for other packages.
- Enums not suggested in namespace use declarations.
- Renaming the namespace of an enum not working correctly.
- Renaming a namespace will affect unrelated namespaces with a similar name.
- Rename symbol of variable will impact named parameter.
- Type inference when iterating over `$this` in foreach.
- Symbols being given Global* alias on autocomplete when multiple definitions exist in workspace including in the current file.
- Missing `isIncomplete` flag on suggestion response in some contexts.
- Usage of `self` in trait not resolving to class that trait used in.
- Removal of line breaks when formatting nested parenthesised logical expressions.
## [1.9.5 - 2023-02-06]
#### Fixed
- Document symbol ranges when `SymbolInformation` is returned instead of `DocumentSymbol` (fixes sticky scroll).
- Docblock types inherited too eagerly causing various param and return type issues.
- Templating issues when trait provides implementation of templated interface.
- Exclude globs working incorrectly.
## [1.9.4 - 2023-01-17]
#### Fixed
- Template inheritance.
- Suggestions when `$this` call chaining.
- `static` type resolution when used as template type argument.
- Nullable types showing incorrectly in hover.
- Not all suggestions showing from types with multiple definitions.
## [1.9.3 - 2023-01-10]
#### Fixed
- False cannot modify readonly property errors.
- Property hover when type is a union of intersection and null.
- Method level `@template` PhpDoc inheritance.
- Template resolution when user has provided overrides for non templated vendor definitions.
## [1.9.2 - 2023-01-04]
#### Fixed
- False write to readonly property in `__get`.
- False undefined property for types that inherit `__get`, `__set` from super type or traits.
- `intelephense.compatibility.correctForArrayAccessArrayAndTraversableArrayUnionTypes` not working for properties.
- False readonly write error for writes to array/ArrayAccess element.
- Namespace rename creating file renames containing backslashes.
## [1.9.1 - 2023-01-03]
#### Fixed
- Missing `random` stubs.
- Missing `xdiff` stubs.
- Handle non-standard `non-empty-string`, `lowercase-string` , `non-empty-lowercase-string` PHPDOC types.
- False error when assigning to readonly property within constructor.
- Remove template/generics licence requirement.
- Undefined methods showing where users may have multiple type definitions of same name in workspace folder.
- Various template issues.
## [1.9.0 - 2023-01-01]
#### Added
- PHP 8.2 support.
- PHPDOC `@template` support.
- Handle non-standard PHPDOC types like `list`. Internally `list<Foo>` is treated as `Foo[]`.
- PHPDOC `callable(Foo $foo): Bar`, `\Closure(Foo): Bar` support. Variadic and default args are not supported in the short form.
- Added undefined property diagnostics. Can be disabled via the `intelephense.diagnostics.undefinedProperties` setting.
#### Changed
- Updated dependencies.
- Updated stubs.
- Signature help provider now returns null instead of empty signatures array as per LSP recommendations.
- composer.json `autoload.psr-4` settings used if available for file renames when renaming namespace.
- Added templated `array_map` stub in order to better infer return type.
#### Fixed
- Performance issue when workspace contains multiple symbols with same name.
- Various issues when `__halt_compiler` appears in file.
- False `never` return type when `die` used in logical expression.
- False undefined method when static used in union return type.
- Completion item documentation showing multiple times for namespace suggestions.
- Type inference for return type of closures.
- False unknown arg name when calling closure with named args.
- False unused imports with enum implements.
- False method compatibility error when overriding base method return type of self with static.
- False method compatibility errors when overriding core methods when targeting PHP versions < 8.1 .
- False undefined variable when variable declared as reference in anon function use clause where anon function is argument.
- Incorrect type inferred when variable appears in nested logical expressions.
- Type resolution when using `parent` keyword and `static` return types.
- Unused private methods not detected if they call self.
- False return type error when using `yield` in `for` expr.
- False duplicate symbol when importing same symbol in different namespace blocks of same name.
- Undefined symbol not reported when import exists in other namespace block of same name.
- False duplicate symbol when defined in match expr.
- Local rename of excluded/stub definition should be allowed.
## [1.8.2 - 2022-02-23]
#### Fixed
- Incorrect completion suggestions for variables.
- False undefined variables in do loop.
- Completion resolve not working.
## [1.8.1 - 2022-02-13]
#### Fixed
- False undefined variable when declared inside expression in conditional statement.
- Fa