1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-14 18:36:58 +01:00
Commit Graph

2887 Commits

Author SHA1 Message Date
Brown
72d1d799b1 Fix #4208 - array with possibly-undefined keys isn‘t really sealed 2020-09-19 15:46:54 -04:00
Brown
f973937aec Fix #4209 - allow hinting arrow function return type 2020-09-19 14:59:19 -04:00
Brown
a8a2a4cb66 Fix #4210 - fix __invoke declaration tracing 2020-09-19 14:18:52 -04:00
Brown
94ed53b25a func_num_args is pure
fixes #4215
2020-09-19 13:58:29 -04:00
Brown
363887a445 Add explicit offset
Fixes #4202
2020-09-17 21:35:30 -04:00
Daniel Badura
7d5dbd3f38
add random_int as stub, returns positive-int if min is positive-int (#4199) 2020-09-17 08:31:31 -04:00
orklah
191495328a
Fix errors in return types (#4189)
* FunctionLikeAnalyzer::verifyReturnType returns void

* ArrayFunctionArgumentsAnalyzer::checkArgumentsMatch returns void

* AssertionFinder::scrapeAssertions can't return null
2020-09-16 17:35:55 -04:00
Brown
dda013dc2e Only refine for matching closure union members
Ref #4136
2020-09-15 09:40:27 -04:00
Brown
0b209864fe Improve accuracy of array_filter 2020-09-14 13:31:53 -04:00
Brown
8d7fe83e2a Improve array_merge return type 2020-09-14 13:06:15 -04:00
Brown
b10c1ac280 Fix style 2020-09-14 12:19:30 -04:00
Brown
1f3215d36b Support more array intersections in type parsing 2020-09-14 12:13:33 -04:00
Brown
02b725f8a2 Add back suppression 2020-09-14 11:02:04 -04:00
Brown
17a0ecb60e Fix regression – detect unused params with defaults again 2020-09-14 10:58:36 -04:00
Brown
1df3c9365c Fix template check 2020-09-14 10:00:09 -04:00
Brown
77e84b3817 Fix a few more things 2020-09-13 23:28:31 -04:00
Brown
c4450b930c Fix various things 2020-09-13 22:39:03 -04:00
Brown
249903e18a Fix style issues 2020-09-13 21:45:07 -04:00
Brown
56bae3b587 Add check for strpos dictionaries
Ref #4070
2020-09-13 21:42:44 -04:00
Brown
8f8dbfbd72 Fix #4122 - detect yield in function arguments 2020-09-13 17:13:26 -04:00
Brown
f180fb23bc Fix #4178 - always detect missing property types 2020-09-13 16:50:50 -04:00
Bruce Weirdan
689027c92d
Support multiple issue types in @psalm-suppress (#4179)
* Accept multiple issue names in `@psalm-suppress`

Fixes vimeo/psalm#1575

* Accept multiple issue types on statement docblocks as well

* Proper highlighting of individual issues in compound suppressions
2020-09-13 16:41:14 -04:00
Bruce Weirdan
cd110c7e2f
Added @psalm-stub-override for classlikes and methods (#4177)
Fixes vimeo/psalm#1252
2020-09-13 16:40:31 -04:00
orklah
da47588f91
replace return; by return null; in every non-void method, add return null; when mising, add return types, remove redundant phpdoc (#4176) 2020-09-13 16:39:06 -04:00
Brown
ded9237176 Fix bad error flagging 2020-09-13 16:38:32 -04:00
Brown
9ed09d2679 Fix #4127 - improve error message for unused closure var 2020-09-12 17:03:11 -04:00
ygottschalk
5b0c9b1a28
added array-size max constraint to greater check (#4175)
added a few unit tests
2020-09-12 16:13:13 -04:00
Brown
09d22cb05c Fix #4169 - add appropriate bounds check 2020-09-12 11:33:26 -04:00
Toshiyuki Goto
ad437c5265
Workaround to PhpScoper group use bug in Box (#4174) 2020-09-12 11:24:40 -04:00
orklah
ead107fa9e
More return types (#4173)
* add native return types

* redundant phpdoc
2020-09-12 11:24:05 -04:00
Brown
6ffe471525 Make new InvalidLiteralArgument issue for strpos refs
Ref #4070
2020-09-10 22:54:32 -04:00
Brown
eda426a594 Improve unique issue solution 2020-09-10 22:54:30 -04:00
Brown
aaede393d4 Fix #4070 - prevent literal strpos argument 2020-09-10 18:28:34 -04:00
Brown
2100dbd8aa Fix #4167 - allow many issues for the same position 2020-09-10 17:41:45 -04:00
Craig Francis
993e112236
Additional MySQL sinks, ref Issue #4155 (#4158) 2020-09-08 11:54:23 -04:00
Brown
fe4af8ff1a Minor fixes 2020-09-07 17:22:43 -04:00
Brown
877a81f808 Always detect return type mismatches from docblock parents 2020-09-07 16:42:25 -04:00
Brown
8737abf3b8 Fix real projects bug 2020-09-07 15:14:14 -04:00
Brown
88e0811cdd Fix #4136 - allow union type properly 2020-09-07 14:08:56 -04:00
Brown
d174fc6f3f Improve fix 2020-09-07 13:19:37 -04:00
Brown
afce416bfb Fix #4136 - allow inference of callabe type param in union of callables 2020-09-07 12:56:47 -04:00
Brown
f78fbbe4c9 Fix #4146 - allow null checks on Iterator::current output 2020-09-07 11:40:36 -04:00
Brown
02a58f787b Fix #4148 - add Closure to scanned classes when arrow function is seen 2020-09-07 11:11:01 -04:00
orklah
8c7423505a
add native param types (#4137)
* add native param types

* redundant phpdoc

* add more param types and adds "?" to nullable types

* remove redundant phpdoc

* add more param types and remove redundant phpdoc

* add more param types and remove redundant phpdoc
2020-09-06 19:36:47 -04:00
Matthijs Kooijman
3335b26cb4
Fixes to LSP protocol (#4143)
* Fix missing parameter in LSP textDocument.didChange

This parameter was accepted, but not documented. Since the JSON-RPC
Dispatcher looks at the comments for type information, it would fail
to find info and produce:

    PHP Notice: Undefined offset: 1 in vendor/felixfbecker/advanced-json-rpc/lib/Dispatcher.php on line 141

Combined with issue #4142, this ended up violating the protocol.

* Ignore out-of-project files in textDocument.completion

Other methods, such as didOpen and didChange already checked for this,
but completion did not. This would lead to funny behaviour, where
triggering completion would cause the file to be analyzed, but only
using the on-disk state. And any changes to the file would never be
analyzed.

This ignores out-of-project files for completion, too.
2020-09-06 19:31:49 -04:00
Matthew Brown
422271b2cf Prevent variables named "haystack" from receiving literal strings
cc @staabm
2020-09-05 00:35:48 -04:00
Matthew Brown
3605eeee04 Support analysing preg_match_all args in reverse to infer matches type 2020-09-04 20:33:02 -04:00
Brown
681eff6dd4 Fix type 2020-09-04 18:35:19 -04:00
Brown
2895402269 Add asterisks 2020-09-04 18:32:51 -04:00
Brown
d3d8c4ed87 Hard code possible bit-shift values 2020-09-04 18:31:50 -04:00