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

308 Commits

Author SHA1 Message Date
Matt Brown
f0ae0e5cb4 Break aparat type combiner 2020-11-21 18:11:29 -05:00
orklah
e04f219948
return static instead of self when static context detected (#4632)
* return this instead of self when static context detected

* replace $this by static
2020-11-19 19:02:25 -05:00
Matt Brown
2e47ca51d5 Fix #4547 - mark unused uses 2020-11-13 13:13:29 -05:00
Matt Brown
13b83e6132 Fix #4545 - allow intersections in more places 2020-11-13 09:43:30 -05:00
Matt Brown
d3464cb22a Fix #4418 - improve try analysis for mixed, too 2020-10-26 09:05:48 -04:00
orklah
62e79fb7ea
param types (#4313) 2020-10-12 15:46:47 -04:00
Matt Brown
939297484c 4.x - rename TFn to TClosure 2020-10-04 23:32:01 -04:00
Matt Brown
14efde286f 4.x - refactor unused variable detection
This turns unused variable detection into an explicit control-flow problem, where before we had a more simplistic mark-and-sweep algorithm
2020-09-30 12:28:13 -04:00
Brown
19f88a2e31 Add improvements from unused variable checks 2020-09-28 00:45:02 -04:00
orklah
a9a364e363
Misc improvements (#4216)
* misc changes

* fix CI
2020-09-20 08:55:28 -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
orklah
f66d57f19d
add native return types (#4116)
* add native return types

* remove redundant phpdoc
2020-09-04 16:26:33 -04:00
Brown
64f08fa9dc Improve Closure::fromCallable handling 2020-08-29 22:02:58 -04:00
Brown
df0d426f61 Fix #4081 - better inference of positive ints 2020-08-28 16:38:50 -04:00
Matthew Brown
ef0486ce35 Add some pure annotations 2020-08-23 13:52:31 -04:00
Brown
7367e8e6c2 Allow assertions of non-empty lists on typed lists
Fixes #3906
2020-07-29 18:10:43 -04:00
Brown
4a5f74c091 Add positive-int type 2020-07-26 15:51:55 -04:00
Brown
76bd5b6278 Refactor type comparison 2020-07-21 19:40:35 -04:00
Brown
95bf7f835b Improve handling of array_map, faking out calls where nececssary 2020-06-25 13:05:34 -04:00
Matthew Brown
58a8cafaf2 Fix #3588 - a really long literal string is non-empty 2020-06-13 16:08:51 -04:00
Matthew Brown
187b944680 Add faster taint analysis 2020-05-22 12:33:29 -04:00
Brown
0fc3398631 Move parsing methods into internal namespace 2020-05-13 19:12:45 -04:00
Brown
8bfe91787d Add the is_list flag to object-like tuples 2020-05-11 08:33:05 -04:00
Brown
640ffdb324 Fix #3323 - make short object-like arrays sealed tuples 2020-05-08 14:36:06 -04:00
Brown
07e5250292 Fix #3273 - add support for func_num_args() in conditional type 2020-05-01 16:02:53 -04:00
Brown
117a4d4d40 Require callable() have a return type when in conditional
Fixes #3260
2020-04-30 23:35:13 -04:00
Brown
5e2af1d7f6 Fix #1518 - add escaping of object-like keys 2020-04-26 17:36:02 -04:00
Brown
35d376cbe7 Fix #3164 - allow nested templates in conditional classes 2020-04-17 00:46:27 -04:00
lhchavez
be87bb7300
Support intersection types for object-like arrays (#3064)
This change allows expressing the intersection of multiple object-like
arrays. The resulting type will contain the (merged via intersection)
properties of all the object-like arrays involved in the intersection.

This should allow to express the resulting type of an `array_merge()`
operation, which is tricky to do in the context of a templated type.
2020-04-08 09:35:53 -04:00
Brown
41b165c096 Remove stray comma 2020-04-07 11:17:52 -04:00
Brown
067104e170 Fix #3084 - keep track of upper and lower bounds of inferred template types 2020-04-07 00:13:56 -04:00
Brown
f3d278609e Remove blank line 2020-04-04 10:14:32 -04:00
Brown
eef4feea0b Throw TypeParseTreeException if template type not recognised 2020-04-04 09:26:19 -04:00
Brown
e3ff856cac Improve treatment of static in intersection 2020-03-27 19:17:44 -04:00
Brown
467da32f84 Fix instanceof static and isa (static::class) handling 2020-03-24 18:58:15 -04:00
Matthew Brown
6058725256 Add prototype for conditional return type 2020-03-22 10:44:48 -04:00
Matthew Brown
0aca01faea Improve fix to #2805 2020-03-14 01:09:12 -04:00
Brown
3c416482ec Fix #2932 - don’t crash when trying to expand callable object-like array 2020-03-09 10:56:37 -04:00
Matthew Brown
202fb7026a Convert explicit array<mixed, ...> to array<array-key, ...> 2020-02-22 11:04:58 -05:00
Brown
bba44e5354 Add interpolation support 2020-02-13 17:37:52 -05:00
Matthew Brown
07a53f6b81 Fix #2789 - Numeric should not be a reserved class name 2020-02-11 22:34:34 -05:00
Brown
d5f71bf529 Localise template checks to class being tested 2020-02-06 16:38:45 -05:00
Matthew Brown
f981c61990 Add slashes 2020-02-02 11:04:29 -05:00
Matthew Brown
b67f661604 Fix #2735 - interpret template check in context of class-string generation 2020-02-02 10:51:18 -05:00
Matthew Brown
5eb2ebc508 Add more type-system protections for bad array args 2020-01-29 23:41:17 -05:00
Matthew Brown
8ccd4860e3 fclose should treat resource as passed-by-reference 2020-01-17 13:12:00 -05:00
Brown
03030d4887 Fix #2583 - don’t convert scalar terms in @method annotations 2020-01-10 11:29:18 -05:00
Matthew Brown
9fa2db1b6c Move Union::getTypes to Union::getAtomicTypes 2020-01-04 12:20:26 -05:00
Matthew Brown
16b8edd583 Fix #2409 - use more robust assertion parsing 2019-12-31 09:10:14 -05:00
Matthew Brown
79be178146 Add associative-array as an alias of array 2019-12-30 17:01:10 -05:00