1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-03 10:07:52 +01:00
Commit Graph

171 Commits

Author SHA1 Message Date
Matt Brown
024bbef5cd
Fix #4743 - simplify assertions generated from array_key_exists check 2021-01-29 11:47:09 +01:00
Matthew Brown
cbd8150fde
Add RedundantPropertyInitializationCheck (#4732)
* Add RedundantPropertyInitializationCheck

* add documentation for RedundantPropertyInitializationCheck (#4734)

Co-authored-by: orklah <orklah@users.noreply.github.com>
2021-01-29 11:47:05 +01:00
Matt Brown
5cf5aecb2f
Fix #3017 - use correct keys when converting list to array 2021-01-29 11:47:04 +01:00
orklah
45d058c2dd
better fix for reconciling iterable and object (#4712) 2021-01-29 11:46:27 +01:00
Matt Brown
9539c0f27f
Fix generic ArrayAccess creation cc @orklah 2021-01-29 11:46:27 +01:00
orklah
1966766a79
Allow reconciling between object and iterable (#4706)
* Allow reconciling between object and iterable

* add tests
2021-01-29 11:46:27 +01:00
Matt Brown
033a209950
Treat $a ?? $b identically to isset($a) ? $a : $b 2021-01-29 11:46:26 +01:00
Matt Brown
5228ff6369
Fix #4699 - treat isset like !== null when variable is defined 2021-01-29 11:46:26 +01:00
orklah
005373bbc2
Detect redundant cast (#4695)
* detect redundant cast

* fix redundant cast issues

* fix redundant cast in tests
2021-01-29 11:46:25 +01:00
Matt Brown
e5f25c7780
Add support for some dependent types 2021-01-29 11:46:25 +01:00
Matt Brown
068907327d
Fix #4637 - prevent regression when negating function call with === false 2021-01-29 11:46:18 +01:00
Matt Brown
3b3239635b
Fix #4626 - array_key_exists should infer type for first arg where possible 2021-01-29 11:46:16 +01:00
Matt Brown
7b4f0745f5
Simplify assertion negations, centralising as much as possible
Now the flag passed to scrapeAssertions just determines the errors emitted
2021-01-29 11:46:16 +01:00
Matt Brown
6f9be03789
Revert "Fix #4624 - allow in_array to work with list arrays"
This reverts commit 08ae85a735.
2021-01-29 11:46:16 +01:00
Matt Brown
191f305aec
Fix #4624 - allow in_array to work with list arrays 2021-01-29 11:46:15 +01:00
Matt Brown
36af6d70d2
Fix tests 2021-01-29 11:46:05 +01:00
Matt Brown
fb5e30850a
Fix #4503 - don’t ignore assertions on possibly-null mixed 2021-01-29 11:46:05 +01:00
Matt Brown
578e65820a
Ensure we flush out re-assigned vars also referenced
Fixes #4488
2021-01-29 11:46:04 +01:00
Matt Brown
57cd29ee9d
Put assignment-in-conditional tests in their own file 2021-01-29 11:46:04 +01:00
Matt Brown
8b44459c7c
Fix overeager inference 2021-01-29 11:45:02 +01:00
Matt Brown
e440baf671
Improve algebra handling a little better 2021-01-29 11:44:33 +01:00
Matt Brown
eef4ea018b
Empty checks variables are really falsy checks 2021-01-29 11:44:31 +01:00
Matt Brown
a57d62b71b
Add logic to weed out unnecessary clauses 2021-01-29 11:44:30 +01:00
Matt Brown
7df404bfb5
Fix #4374 - prevent paradox and allow Psalm to understand more assignments in conditionals 2021-01-29 11:41:13 +01:00
Matt Brown
481cf84b94
Don’t overwrite true flag 2021-01-29 11:39:58 +01:00
Matt Brown
74d6f166c1
Be more explicit about negation 2021-01-29 11:39:58 +01:00
Matt Brown
8043683f26
Ignore just-coerced vars 2021-01-29 11:39:58 +01:00
Matt Brown
596811cdc1
Suppress errors from fake statements 2021-01-29 11:39:58 +01:00
Matt Brown
c5c177a80a
Improve binary op || analysis for chain 2021-01-29 11:39:57 +01:00
Matt Brown
596e71d6aa
Unskip now-working tests 2021-01-29 11:39:57 +01:00
Matt Brown
2d8d1b9bf7
Fix #4354 - allow assignments on RHS of || in if conditional 2021-01-29 11:39:57 +01:00
Matt Brown
da79106a6a
Fix #4349 - improve types for suggested unions 2021-01-29 11:39:57 +01:00
Matt Brown
4f60d2dd4d
Fix #4347 - fix combinatorial expansion when negating if conditions 2021-01-29 11:39:56 +01:00
Matt Brown
0f8b017384
Prevent features pre-php-8 2021-01-29 11:39:54 +01:00
Matt Brown
278a306681
Do arithmetic for preg_split arguments 2021-01-29 11:39:53 +01:00
Matt Brown
01781af718
Fix #4306 - negating positive-numeric is useless, avoid crash 2021-01-29 11:39:51 +01:00
Matt Brown
3f5cb4db1f
Warn about impossible/redundant conditions in RHS of || 2021-01-29 11:39:50 +01:00
Matt Brown
d1b81e9b80
Improve error message 2021-01-29 11:39:50 +01:00
Matt Brown
2a755cce8c
Always check LHS of or condition before applying to RHS 2021-01-29 11:39:49 +01:00
Matt Brown
9bbb11599a
4.x - change/remove some default config values 2021-01-29 11:39:48 +01:00
Matt Brown
956199c688
4.x - add support for the nullsafe operator 2021-01-29 11:39:47 +01:00
orklah
e3e5a55907
unused use statements (#4228) 2021-01-29 11:39:42 +01:00
Brown
ec64ae930a
Fix a couple of false-positive redundant conditions 2021-01-29 11:39:38 +01:00
orklah
db45ff1ba4
More return types (#4173)
* add native return types

* redundant phpdoc
2021-01-29 11:38:57 +01:00
Brown
568cbfb1be
Fix tests 2021-01-29 11:38:56 +01:00
Brown
b84e88f342
Fix #4154 - treat literal numeric strings as numeric 2021-01-29 11:38:56 +01:00
orklah
61512da144
add native return types (#4116)
* add native return types

* remove redundant phpdoc
2021-01-29 11:38:53 +01:00
Brown
e3d7d0315a
Fix #4109 - detect duplicate match condition 2021-01-29 11:38:52 +01:00
Brown
eae55eb584
Fix #4093 - prevent redundant condition in presence of positive-int 2021-01-29 11:38:50 +01:00
Brown
c96ba8d1f5
Add some backwards-incompatible changes for 4.x 2021-01-29 11:38:48 +01:00