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

244 Commits

Author SHA1 Message Date
Brown
bf5e178d16 Fix #3289 - treat property on non-generic type like actual value 2020-05-02 23:37:59 -04:00
Brown
2ce65e1d03 Fix #3270 - support multiple spaces before @param 2020-05-02 19:39:10 -04:00
Brown
5e2af1d7f6 Fix #1518 - add escaping of object-like keys 2020-04-26 17:36:02 -04:00
Brown
6b42efed3f Fix #3150 - only inherit docblock return when same type is returned 2020-04-20 09:22:58 -04:00
Brown
a1bec0cd5a Consolidate generator tests 2020-04-06 08:57:18 -04:00
Brown
8f8cc6aed5 Move conditional return type tests 2020-04-04 09:27:11 -04:00
Matthew Brown
194f02507d Allow conditional types to reference class constants 2020-03-29 13:37:37 -04:00
Matthew Brown
5ad55ae693 Fix type inference on simple conditional function calls 2020-03-29 10:42:57 -04:00
Matthew Brown
0e919a0696 Allow arithmetic on simple templated types 2020-03-29 10:34:46 -04:00
Matthew Brown
788da0680e Allow var_export userland implementation 2020-03-29 10:19:09 -04:00
Matthew Brown
1439c90789 Add support for conditional checks on literal ints & strings 2020-03-29 10:02:24 -04:00
Matthew Brown
6058725256 Add prototype for conditional return type 2020-03-22 10:44:48 -04:00
Matthew Brown
0022de1f13 Fix #946 - allow too many arguments when one of union agrees 2020-03-15 13:44:00 -04:00
leightonthomas
60fb3924bc Fix #2914 - falsable functions who only expect true now produce errors 2020-03-09 14:25:18 -04:00
leightonthomas
06f7df9974 Fix #1799 - support trailing commas in type aliases 2020-03-05 15:36:28 -05:00
Brown
e934343d7f Fix #2765 - properly fix namespaced @throws self 2020-02-13 13:01:53 -05:00
Matthew Brown
f64cdd2ca2 Fix #2798 - strip out trailing commas in object-like @return types 2020-02-12 09:18:43 -05:00
Brown
8f95c5679e Fix #2720 - allow throwing self 2020-01-30 18:00:31 -05:00
Brown
0ffb833bf3 Fix #2677 - use better assertion for null coalesce 2020-01-23 14:52:35 -05:00
Matthew Brown
389af1bfc7 Fix #2618 setting list param from docblock 2020-01-14 22:46:19 -05:00
Matthew Brown
ef3c2d30c9 Fix #2613 - allow docblock-defined object-like as non-empty-array 2020-01-13 21:05:30 -05:00
Brown
3a7dd61889 Fix #2457 - allow psalm-type aliases to be used above return type 2019-12-11 10:30:40 -05:00
Brown
cff354ef28 Fix test 2019-11-21 16:51:23 -05:00
Brown
78a3894403 Fix Psalm errors 2019-11-21 11:03:18 -05:00
Bruce Weirdan
c50a17d415 Scan shape properties (#2359)
This prevents crashes when built-in classes are referenced by shape
properties.

Fixes vimeo/psalm#2331
2019-11-18 19:01:12 -05:00
Brown
267ae3a568 Move docblock inheritance tests into separate place 2019-09-25 12:02:59 -04:00
Matthew Brown
af0331c251 Fix #1997 - fix reconciliation of arrays and traversables 2019-08-10 14:39:14 -04:00
Jeffrey Yoo
73a6fbe557 catch cases of invalid use of backslash (#1983) 2019-08-01 16:10:12 -04:00
Matthew Brown
da42be175f Apply PHPCS fixes
Fixes #1880
2019-07-05 16:27:53 -04:00
LeSuisse
f29826b958 Fully qualify constants and function calls (#1849)
This should give a small performance boost.
Part of #1837.

The change is enforced via phpcs and can be autofixed
with phpcbf.
2019-06-26 16:52:29 -04:00
Brown
5ed49c0c03 Fixed #1848 - allow static class strings to be compared 2019-06-26 15:11:16 -04:00
Matthew Brown
2a4072b1be Resolve docblock self refs as soon as possible
Fixes #1827
2019-06-20 23:38:10 -04:00
Brown
b12f05185a Fix #1799 - support trailing commas in object-like docblock types 2019-06-18 17:47:06 -04:00
Matthew Brown
f46ccf0a5d Strip text from end of @psalm-type 2019-06-16 12:39:07 -04:00
Brown
20422cf223 Fix #1730 - parse @param * $foo properly 2019-06-03 15:46:25 -04:00
Matthew Brown
62be1cc1b0 Add rest of files 2019-06-01 16:57:33 -04:00
Brown
0bd4dbcbc4 Bump to PHP 7.1
Fixes #1650
2019-05-16 18:36:36 -04:00
Brown
66bbe5bb74 Allow space in intersection type
Ref #1645
2019-05-16 13:52:58 -04:00
Matthew Brown
3599c20316 Fix #1641 - crawl intersection types 2019-05-15 22:30:35 -04:00
Brown
4a434d9a2f Add separate issue for undefined classes in docblocks 2019-05-15 18:41:26 -04:00
Brown
24dbc34bbe Use better solution for inherited more-specific return types 2019-05-09 10:41:30 -04:00
Brown
629eeed3e6 Fix incorrect message when inheriting parent docblock 2019-05-09 10:26:06 -04:00
Matthew Brown
0fe378a467 Fix #1593 - still inherit more specific docblock from parent when parent has no signature return 2019-05-01 23:14:22 -04:00
Brown
0e4c8ce482 Split apart TypeCoercion issues, allowing more granular issue filtering 2019-04-25 18:02:19 -04:00
Brown
2121f0485e Make tests more resilient 2019-04-09 14:29:09 -04:00
Brown
fb1eba9b61 Fix #1473 - add support for ...&x in docblocks 2019-04-09 14:23:48 -04:00
Brown
1348d634ed Improve handling of variadic parameters 2019-04-09 13:58:49 -04:00
Matthew Brown
c772914910 Add some formatting 2019-03-23 14:27:54 -04:00
Matthew Brown
b73dd8ebe4 Fix #1447 - always inherit docs from parents 2019-03-16 00:31:17 -04:00
Matthew Brown
472cdf6bea Fix #1379 - allow @param-out to change type 2019-03-03 15:11:09 -05:00
Bruce Weirdan
9bdc9f774f More provider typing 2019-03-02 08:43:19 -05:00
bugreportuser
65102b8088 Fix non-empty-array @param in namespace (#1416) 2019-03-02 08:35:50 -05:00
SignpostMarv
87021c315f fixing some tests under windows again (following on from #1292) 2019-02-28 17:53:36 -05:00
Brown
601f303de2 Fix position of invalid param 2019-02-27 16:00:44 -05:00
Brown
119687f934 Fix redundant condition message when negating a docblock type 2019-02-27 14:02:02 -05:00
Matthew Brown
6af222f36a Fix #1393 - support analysing non-empty-array calls 2019-02-27 09:08:27 -05:00
Matthew Brown
fff56f7b26 Use better heuristic to determine missing types 2019-02-23 11:39:00 -05:00
Matthew Brown
6671e0dc7c Fix #1382 - flag unused docblocks 2019-02-23 11:02:04 -05:00
Brown
1e2c29041f @param-out should not override @param byref type def
when checking for unuitialised vars
2019-02-20 18:53:42 -05:00
Brown
d2968081f8 Fix #1370 - allow phpstorm generic iterator 2019-02-20 11:13:40 -05:00
Brown
0f45d14fea Only collapse Traversable|array when we’re super sure it’s safe
Fixes #1333
2019-02-15 11:07:08 -05:00
Matthew Brown
0bca8db561 Don’t throw exception when property is missing type 2019-02-07 18:10:32 -05:00
Matthew Brown
db89b3cc3f Add initial support for fixing MissingParamType 2019-02-02 11:28:48 -05:00
Matthew Brown
16c2a0f899 Fix #1246 - check @var annotations 2019-01-26 17:30:44 -05:00
Matthew Brown
22ee72808a Remove a bunch of hacks around generic offsets
Also fixes #1245
2019-01-26 16:58:49 -05:00
Matthew Brown
5eb0bb8126 Make foreach var annotation use more cautious 2019-01-20 11:49:13 -05:00
Matthew Brown
ee2b06ac43 Add initial support for @param-out 2019-01-19 13:32:43 -05:00
Matthew Brown
545c7e3cba Fix #1211 - allow docblocks to override foreach type earlier 2019-01-19 11:31:51 -05:00
Matthew Brown
4ec7903e8b Fix #390 - add support for object{foo:int, bar:string} annotation 2019-01-18 00:56:24 -05:00
Brown
d1654b9bf4 Ignore @return with a newline after @return 2019-01-09 11:51:29 -05:00
Brown
73770c085e Prevent crash when @template as type is missing 2019-01-08 15:11:57 -05:00
Brown
f3133aac84 Prevent more crashes 2019-01-08 14:50:45 -05:00
Matthew Brown
5f34f6c478 Fix #1115 - allow a parent @throws to capture children 2018-12-05 22:50:16 -05:00
Matthew Brown
b32000fa05 Fix #689 - add checks for @internal annotations 2018-12-01 18:37:49 -05:00
Matthew Brown
af041abdcb Fix #1093 - add exception type to list of scanned classes 2018-11-25 16:14:50 -05:00
Matthew Brown
4688b25fd9 Move internal classes to own namespace 2018-11-12 11:20:59 -05:00
Brown
f017599b3f Fix how InvalidDocblock is treated
Fixes #1051 (hopefully)
2018-11-01 17:03:08 -04:00
Matt Brown
e323d15174 Fix #972 - allow type aliases to be used within functions 2018-09-24 13:08:23 -04:00
Matt Brown
dce8d14e1b Fix syntax errors in tests 2018-09-17 12:15:45 -04:00
Matthew Brown
84459286ac Fix #973 - allow types to reference other new types in a given docblock 2018-09-04 22:27:55 -04:00
Matthew Brown
867ebd4441 Fix #953 - support spaces either side of | 2018-08-22 22:53:44 -04:00
Matt Brown
91100edcc9 Fix issue mixing class strings and class string constants 2018-08-21 14:47:28 -04:00
Matthew Brown
8814dff3c1 Fix #947 - interpret type hints of unpacked args 2018-08-20 22:11:01 -04:00
Matthew Brown
695ececc22 Add tests for 7c10a09 2018-08-08 22:44:02 -04:00
Matthew Brown
cc28ff7ad6 Fix #904 - scan all docblocks for possible @psalm-type annotations 2018-07-21 22:24:33 -04:00
Matthew Brown
1e54c61fde Fix #18 - add support for @psalm-type 2018-07-15 17:23:17 -04:00
Matthew Brown
0d62431cfb Fix #870 - improve magic method type handling 2018-07-07 00:06:05 -04:00
Matt Brown
71b2420c83 Fix #865 - support literals in return types 2018-07-05 17:25:26 -04:00
Matt Brown
c872f9179e Remove mixed in @method param types 2018-06-28 17:39:25 -04:00
Matthew Brown
e3ae1bf26f Fix #15 - check for uncaught throws if config flag is set 2018-06-22 01:13:49 -04:00
Matt Brown
47a40b2ffc Fix #817 - allow methods named "global" in @method annotations 2018-06-14 17:20:02 -04:00
Matt Brown
54893fdd55 Fix #808 - detect badly-placed ampersand early 2018-06-11 17:23:28 -04:00
Matthew Brown
068dc50b21 Fix #792 - allow docblock array form of variadic arg 2018-06-08 21:18:49 -04:00
Matthew Brown
c1586ee347 Remove union types in magic methods for now 2018-06-07 19:56:28 -04:00
Matt Brown
f030f4f40d Allow docblock types to be merged with param default ones 2018-06-07 12:23:21 -04:00
Matt Brown
51e7042022 Fix #789 - allow union types in @method params 2018-06-05 17:59:32 -04:00
Matt Brown
d55afc1fb1 Fix #779 - allow docblock to take on nullablility of typehint 2018-05-29 09:44:38 -04:00
Matthew Brown
81ae1ca222 Fix #747 - allow Generator to replace Traversable in templated params 2018-05-28 22:26:43 +01:00
Matt Brown
a30d229040 Fix issue with slashes after ? in type 2018-05-21 12:55:44 -04:00
Matt Brown
aebbd473d9 Fix issues reconciling class-string params to actual types 2018-05-21 12:40:39 -04:00