Notable changes
Float values handling
Allows the usage of float values, as follows:
class Foo
{
/** @var 404.42|1337.42 */
public readonly float $value;
}
Literal boolean true
/ false
values handling
Thanks @danog for this feature!
Allows the usage of boolean values, as follows:
class Foo
{
/** @var int|false */
public readonly int|bool $value;
}
Class string of union of object handling
Allows to declare several class names in a class-string
:
class Foo
{
/** @var class-string<SomeClass|SomeOtherClass> */
public readonly string $className;
}
Allow psalm
and phpstan
prefix in docblocks
Thanks @boesing for this feature!
The following annotations are now properly handled: @psalm-param
, @phpstan-param
, @psalm-return
and @phpstan-return
.
If one of those is found along with a basic @param
or @return
annotation, it will take precedence over the basic value.
Full list of changes
Features
- Allow
psalm
andphpstan
prefix in docblocks (64e0a2) - Handle class string of union of object (b7923b)
- Handle filename in function definition (0b042b)
- Handle float value type (790df8)
- Handle literal boolean
true
/false
types (afcedf) - Introduce composite types (892f38)
Bug Fixes
- Call value altering function only if value is accepted (2f08e1)
- Handle function definition cache invalidation when file is modified (511a0d)