1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-13 09:47:29 +01:00
Commit Graph

7198 Commits

Author SHA1 Message Date
orklah
b5b2677ee3 allow negating inferiorto/superiorto 2021-09-19 19:30:01 +02:00
orklah
b3a62c76dd add tests and use getNewHighestBound at one place 2021-09-19 19:30:01 +02:00
orklah
c20c1b5002 better div and modulo inference 2021-09-19 19:30:01 +02:00
orklah
05fb0c326d fix CS 2021-09-19 19:30:01 +02:00
orklah
3ad60cfdb9 Allow combining and improve comparison 2021-09-19 19:30:00 +02:00
orklah
e10b0fc3e9 use TIntRange in isAlwaysTruthy 2021-09-19 19:30:00 +02:00
orklah
55b45853de try not to remove null after a positive-numeric assertion 2021-09-19 19:30:00 +02:00
orklah
219e425894 handle nightmare isset assertions 2021-09-19 19:30:00 +02:00
orklah
ee75586fbf expand test and fix assertions 2021-09-19 19:30:00 +02:00
orklah
d2e1388473 Allow inferior-to and superior-to even with negated numbers 2021-09-19 19:30:00 +02:00
orklah
21ceaa7dc7 reconcile positive-int with superior/inferior to 2021-09-19 19:30:00 +02:00
orklah
61d1d1660d handle the div case when even if min/max are integers, there may be float between them 2021-09-19 19:30:00 +02:00
orklah
168b1d8f0f fix wrong check with contains 2021-09-19 19:30:00 +02:00
orklah
9505411738 remove type by key instead of targetting global int 2021-09-19 19:30:00 +02:00
orklah
c3afe103c5 allow asserting positive int on an int range 2021-09-19 19:29:59 +02:00
orklah
4682c4be5e remove unnecessary var 2021-09-19 19:29:59 +02:00
orklah
86afff61c5 allow combining TIntRange with other ints 2021-09-19 19:29:59 +02:00
orklah
8325378e23 support inverted comparison and remove null after value comparison 2021-09-19 19:29:59 +02:00
orklah
ca4c18c30d put assertions back 2021-09-19 19:29:59 +02:00
orklah
1dcdaea117 int range arithmetics 2021-09-19 19:29:59 +02:00
orklah
96adb96dab fix or suppress cases in Psalm 2021-09-12 23:12:23 +02:00
orklah
44bfa2c21c flag alwaysTruthy conditions as redundant 2021-09-12 22:53:44 +02:00
S.M. Ataur Rahman
c13ed7cc28 type of "$http_response_header" is "list<string>" now 2021-09-09 01:36:07 +06:00
Bruce Weirdan
b4f024b1fe
Basic enum checks
* Duplicate cases
* Duplicate case values
* Invalid case values: value on a pure enum case, missing value on a
backed enum case, backing type / case type mismatch
* Literal expression evaluation for case values

Fixes vimeo/psalm#6426
Fixes vimeo/psalm#6427
2021-09-07 12:35:38 +03:00
Bruce Weirdan
0f2152ac97
Merge pull request #6434 from weirdan/flag-invalid-enum-backing-type
Flag invalid backing types for enums
2021-09-05 20:30:01 +03:00
Bruce Weirdan
7b11024886
Flag invalid backing types for enums
Fixes vimeo/psalm#6428
2021-09-05 20:12:24 +03:00
Bruce Weirdan
abf557da44
Encode XML output consistently
This fixes test failures when running on PHP 8.1, due to changed
`htmlspecialchars()` defaults
2021-09-05 20:06:59 +03:00
Bruce Weirdan
5dfd157d72
Merge pull request #6420 from orklah/ternary-override-type
Ternary override type when reassigning
2021-09-04 21:58:32 +03:00
Bruce Weirdan
b710aab148
Merge pull request #6419 from TysonAndre/in_array-fix 2021-09-04 21:56:36 +03:00
Bruce Weirdan
3a3fde332e
Merge pull request #6392 from orklah/control-action-test 2021-09-04 21:38:08 +03:00
orklah
0825f220fe allow ternary to override previous type when reassigning 2021-09-04 20:22:06 +02:00
Tyson Andre
58e7ae1809 Also support non-literal types in strict in_array() check
Modified approach to #6396 by orklah

Fixes #6333

Co-Authored-By: orklah <ronan_morin@hotmail.com>
2021-09-04 12:34:49 -04:00
Bruce Weirdan
d9ceb8779f
Merge pull request #6398 from orklah/array_is_list 2021-09-04 15:55:23 +03:00
orklah
f9b37cea5b name error 2021-09-04 14:08:04 +02:00
orklah
c8cf503367 introduce isAlwaysFalsy and isAlwaysTruthy 2021-09-04 13:56:13 +02:00
orklah
9cd8917b88 create callmap for 8.1 and introduce array_is_list 2021-09-04 13:25:23 +02:00
orklah
e99c1951ae Make Psalm understand infinite while loop in control actions 2021-09-02 22:28:01 +02:00
Bruce Weirdan
a655ca81c1
Merge pull request #6391 from ro0NL/6388 2021-09-02 23:23:32 +03:00
orklah
854858a3bc this should have less impact 2021-09-02 20:55:50 +02:00
Roland Franssen :)
27faf9502e 😓 2021-09-02 20:39:03 +02:00
Roland Franssen :)
a4356089ef fix 2021-09-02 20:37:21 +02:00
Roland Franssen :)
4bf4d8e451 Forbid empty() 2021-09-02 20:32:05 +02:00
orklah
58e578e6a7 fix Generator giving templates to Iterator 2021-09-02 20:12:32 +02:00
Bruce Weirdan
eb973ab2e1
Merge pull request #6335 from boesing/bugfix/recursive-class-aliases 2021-08-31 23:51:19 +03:00
Bruce Weirdan
b713140cc1
Merge pull request #6326 from piporoid/issue/2164
Prevent @property annotations on class properties
2021-08-31 23:46:56 +03:00
Bruce Weirdan
cbcc38aab8
Merge pull request #6339 from niconoe-/allow-object-on-array_walk 2021-08-31 23:45:10 +03:00
Bruce Weirdan
103b2b7244
Warn about array_walk_recursive over objects 2021-08-31 23:18:20 +03:00
Bruce Weirdan
624246b996
Merge pull request #6376 from orklah/use-variable-in-backtick 2021-08-29 04:39:13 +03:00
orklah
27b6d5ad3b fix psalm errors 2021-08-29 00:39:36 +02:00
orklah
10c20dc8f3 mark variable used in backticks as used 2021-08-29 00:26:52 +02:00