1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-13 17:57:37 +01:00
Commit Graph

4789 Commits

Author SHA1 Message Date
orklah
204d09b271 fix error with 0 being considered positive 2022-01-25 21:54:55 +01:00
orklah
7c8441baec
Merge pull request #7123 from AndrolGenhald/feature/942-type-annotate-class-constants
Support type annotations for class consts (fixes #942).
2022-01-25 20:54:40 +01:00
Matthew Brown
c974f23852 Simplify context references 2022-01-24 16:35:42 -05:00
Matthew Brown
18f5446924 Remove unnecessary hack embedding IfScope in Context object 2022-01-24 14:00:20 -05:00
Matthew Brown
61d450a267 Fix combination of templated types 2022-01-24 13:56:32 -05:00
Matthew Brown
8ee10ef78c Fix indentation 2022-01-24 13:22:18 -05:00
Matthew Brown
944b281cbe Prevent negation from removing unmatched template vars 2022-01-24 13:20:02 -05:00
Matthew Brown
c7d938bbbe Remove unnecessary code in Context::removeDescendants 2022-01-24 10:34:48 -05:00
Matthew Brown
ab2b77d9f5 Fix unnecessary array merge
This operation is already performed on line 420
2022-01-23 23:17:51 -05:00
orklah
63b802bff4 remove TPositiveInt 2022-01-23 23:49:23 +01:00
orklah
7c4f08067b Merge remote-tracking branch 'upstream/4.x' into upstream-master5 2022-01-23 23:44:04 +01:00
orklah
c90cffd382
Merge pull request #7472 from orklah/intrange
remove TPositiveInt usage for TIntRange
2022-01-23 22:04:33 +01:00
orklah
a7b72b865f remove TPositiveInt usage for TIntRange 2022-01-23 22:04:18 +01:00
orklah
5e41e1445e
Merge pull request #7470 from orklah/array_is_list2
reconcile two arrays by intersecting them
2022-01-23 20:36:04 +01:00
orklah
70142427bc reconcile two arrays by combining them 2022-01-23 20:22:12 +01:00
Matthew Brown
865a9f81bc Remove nullability from properties that don’t need them 2022-01-23 14:18:53 -05:00
orklah
82d84b0b3a fix internal properties on interfaces 2022-01-23 13:08:35 +01:00
AndrolGenhald
1f1f1c53fe Fix CS issue due to rebase. 2022-01-22 17:09:50 -06:00
AndrolGenhald
0fe2f6f951 Refactor existing method to reduce redundant code. 2022-01-22 17:06:54 -06:00
AndrolGenhald
1686f28a37 Default to using inferred type unless in late static binding context. 2022-01-22 17:06:54 -06:00
AndrolGenhald
0fb0632e0d Infer type from known ternary condition. 2022-01-22 17:06:54 -06:00
AndrolGenhald
558208e44e Add type checking for class const assignments, fix several other const issues. 2022-01-22 17:06:54 -06:00
AndrolGenhald
c877ce031e Use inferred type instead of annotated type where possible. 2022-01-22 17:06:54 -06:00
AndrolGenhald
df314658a5 Fix trailing comma. 2022-01-22 17:06:54 -06:00
AndrolGenhald
c18a155f77 Support type annotations for class consts (fixes #942). 2022-01-22 17:06:53 -06:00
orklah
e0d3c3f217
Merge pull request #7463 from orklah/Properties
fix code where the offset was wrong
2022-01-22 21:24:59 +01:00
orklah
b9655457da fix code where the offset was wrong 2022-01-22 21:09:37 +01:00
AndrolGenhald
3510f55e31 Check for indirect circular dependencies with stubbed parents. 2022-01-22 13:56:10 -06:00
AndrolGenhald
9a064c04cf Fix invalid trailing comma. 2022-01-22 13:56:10 -06:00
AndrolGenhald
2262cb65d3 Check for circular references with stubbed classes. 2022-01-22 13:56:08 -06:00
AndrolGenhald
db67d2c6e8 Add support for checking parent classes and interfaces from stubs. 2022-01-22 13:54:42 -06:00
orklah
0e891f25ad refactor description of types in Atomic 2022-01-22 19:34:57 +01:00
orklah
841d4f4429 improve support for enum_exists 2022-01-22 18:27:24 +01:00
orklah
070a1cc7a3 fix merge induced errors 2022-01-22 18:05:32 +01:00
orklah
af1888b631 Merge remote-tracking branch 'upstream/4.x' into upstream-master4 2022-01-22 17:48:42 +01:00
orklah
73af019110 fix a weird case 2022-01-22 17:45:40 +01:00
orklah
997d5d5f5f handle two more cases of firstClassCallable 2022-01-22 17:37:35 +01:00
orklah
d1a946c221
Merge pull request #7454 from petewalker/feat/native-intersections
feat: Handle native intersection types
2022-01-22 11:18:54 +01:00
Pete Walker
be6ce777ff
chore: Better exception messages 2022-01-22 10:12:48 +00:00
Pete Walker
057a99c9f1
fix: Tests / minor bug 2022-01-22 00:00:45 +00:00
Pete Walker
41a3807693
fix: Lint issue 2022-01-21 17:39:01 +00:00
Pete Walker
299eca4daa
fix: Add PHP version checks / more tests 2022-01-21 17:31:48 +00:00
Toon Verwerft
6b789bb5a7 [TypeProvider] Provide argument types during FunctionParamsProviderEvent 2022-01-21 16:32:40 +01:00
Pete Walker
a3bdf1ba8c
feat: Handle native intersection types
Adds native intersection type handling to psalm, removing the previous `UnexpectedValueException`.

Where an intersection is found in the parse tree, the types are resolved using the existing `Type::intersectUnionTypes` function, which I assume is being used when they're encountered in the existing docblock annotations.

I've added a handful of tests to cover this, but they're certainly not exhaustive. Are there any specific edge cases I should target?

This change feels way too simple... so apologies if I've missed something fundamental..!
2022-01-21 12:59:55 +00:00
orklah
35577dfd28 fix typo 2022-01-21 00:29:22 +01:00
orklah
f9b26acf6e Array key exists assert both ways 2022-01-21 00:26:37 +01:00
orklah
f9e392316f remove unused imports 2022-01-21 00:17:06 +01:00
orklah
fe9d3f02a8 nitpicks 2022-01-20 23:47:41 +01:00
Matthew Brown
0a81f8cd6c
Use objects, not strings, for assertions (#7410)
* Use objects, not strings, for assertions

* Remove unnecessary param

* Remove some unnecessary checks

* Fix bad find/replace

* Add note about assertions no longer stored as strings in UPGRADING.md
2022-01-20 17:33:06 -05:00
orklah
6f1a5e8a47
Merge pull request #7417 from klimick/partially-applied-closure-inference
Contextual type inference for high order function arg
2022-01-20 21:03:46 +01:00