Matthew Brown

Results 64 comments of Matthew Brown

@Ciantic I'm afraid I'd have to decline. While Psalm has benefited from the work @felixfbecker has done ([Psalm has some language server support built-in](https://psalm.dev/docs/running_psalm/language_server/)) I don't have time to take...

Building a good type inference engine capable of finding bugs (the primary aim of Psalm, PHPStan and others) and building a language server that makes writing code more convenient (the...

In the meantime you could use something like this: https://phpstan.org/r/dfdb88c1-60df-438f-8808-0dc475c5c23e https://psalm.dev/r/f4b256d3d5

I think the only way to prevent this is to prohibit `new static` for all generic classes

FYI I solved this in Psalm by introducing a `@psalm-consistent-templates` annotation that works similarly to `@psalm-consistent-constructor` (which itself duplicates the behaviour of ``). Using it forces all child classes to...

One workaround is to enclose the `CASE ... END` expression with brackets

Psalm has three sources of types: - CallMap.php (virtually identical to PHPStan's functionMap as they're based on the same file in Phan's source code) - CoreGenericFunctions.php/CoreGenericClasses.php and other files in...

Impure builtin functions are listed here: https://github.com/vimeo/psalm/blob/master/src/Psalm/Internal/Codebase/Functions.php#L280 All others are assumed pure

This was slightly poor design on my part. We could add a config that would make `array{a: int, b: string}` strict and `array{a: int, b: string}&array` the flexible version. In...

I think this is a fine v5 change if you want to target September. Sorry I haven’t been more active, but I wanted to say earlier: when it comes to...