1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00
Commit Graph

176 Commits

Author SHA1 Message Date
orklah
c4eb548603 more precise type 2021-10-13 11:22:40 +02:00
orklah
83f2cf2eac switch the test from invalid to valid 2021-10-13 11:22:40 +02:00
orklah
690c24f824 array unpacking with strings 2021-10-13 11:22:40 +02:00
orklah
b9f14f8687 improve min/max inference, add a return type provider for rand, mt_rand and random_int 2021-10-02 09:53:58 +02:00
orklah
9ca771286f fix test 2021-08-09 21:18:19 +02:00
orklah
e688781383 seal the result of two sealed KeyedArrays 2021-08-09 20:43:17 +02:00
orklah
79478a60b1
Allow class constant as offset key (#5943)
* allow class-constant as an array offset when the type match

* remove object with __toString as a possible offset as it's not valid
2021-06-17 18:15:57 -04:00
Matt Brown
b33f87f68d Treat all assignment operations as equivalent binary ops 2021-06-04 14:39:38 -04:00
Matt Brown
ccd50fdb34 Fix ##5795 - array casts should always be lists 2021-05-19 15:17:50 -04:00
Matt Brown
12844621b4 Fix #5693 - revert fix for #2048
The original fix was just a bit too narrow, and led to this bug
2021-05-01 21:13:42 -04:00
AndrolGenhald
de5a031088
Improve @no-named-arguments support and variadics. (#5455)
* Improve @no-named-arguments support and variadics.

Handling of argument unpacking and variadics still needs a pretty big makeover, but this is a good start.

Fixes #5420
Improves #5453 (iterable works, array still causes issues)

* Remove unneeded imports.
2021-03-22 19:58:22 -04:00
AndrolGenhald
0579c1109b
Fix bugs with array spread operator (fixes #5421) (#5433) 2021-03-19 22:43:58 -04:00
AndrolGenhald
17f23ccb30
Fix false-positive with non-empty object like array (fixes #5436) (#5437) 2021-03-19 21:54:01 -04:00
AndrolGenhald
b859fba52d
Fix array spread false negative that crashes (fixes #5431, reverts #2852) (#5432) 2021-03-19 21:51:36 -04:00
AndrolGenhald
d4590711d6
Fix object-like array keys when combining string and automatic keys (fixes #5427). (#5428)
* Fix object-like array keys (fixes #5427).

* Fix incorrect return types for tests.

* Fix false positive list with literal int key.
2021-03-19 21:44:44 -04:00
orklah
7a40443ffb
don't throw InvalidArrayOffset when dealing with templates (#5019) 2021-01-14 16:35:06 -05:00
orklah
f9fccb2b2d
implement DTO for plugins (#4881)
* implement DTO for plugins

* introduce EventHandler + reintroduce legacy API for plugins
2021-01-06 09:05:53 -05:00
orklah
3684ceff4c
Illegal offset (#4865)
* Illegal offset access

* add tests

* fix tests
2020-12-26 10:33:49 +00:00
Matt Brown
6eae582763 Prevent mixed array offset in array creation
Fixes #4846
2020-12-16 08:18:18 -05:00
Matt Brown
e702e472fc Support simple list assignment in foreach
Ref #4741
2020-12-06 19:14:52 -05:00
Matt Brown
b64eb6d716 Break out array_key_exists tests 2020-12-02 14:42:16 -05:00
Matt Brown
e7f9ce6da0 Break out RedundantCast issues 2020-12-01 17:25:45 -05:00
orklah
4bbb72329e
Fix PHPMAXINT offset (#4707) 2020-11-26 09:24:32 -05:00
orklah
b6a3282589
Detect redundant cast (#4695)
* detect redundant cast

* fix redundant cast issues

* fix redundant cast in tests
2020-11-25 12:04:48 -05:00
Matt Brown
2c5f767098 Fix tests 2020-11-23 15:51:58 -05:00
orklah
b6cb9785ac
Prevent illegal array keys (#4660)
* Emit an issue when an array-key is not legal

* tests
2020-11-23 15:20:39 -05:00
Axel H
271e0d86be
Fix type inference when unpacking typed iterables (#4487)
* Add test for unpacking typed iterables

* Fix type inference when unpacking typed iterables into arrays

* Fix possibly undefined array offset
2020-11-06 17:24:01 -05:00
orklah
ead107fa9e
More return types (#4173)
* add native return types

* redundant phpdoc
2020-09-12 11:24:05 -04:00
Brown
92239add4d Add some backwards-incompatible changes for 4.x 2020-08-30 11:44:14 -04:00
Brown
c13b0efd49 Improve understanding of negated count queries 2020-08-30 11:32:01 -04:00
Brown
6ab3e732fb Fix #4038 - don’t remove null types unnecessarily in mixed union 2020-08-25 15:50:33 -04:00
Brown
bcf0df4170 Fix a bug with lowercase-string unions 2020-08-05 20:05:57 -04:00
Brown
bc053e5ee8 Fix #3923 - remember class name when appending array with key 2020-08-03 01:34:46 -04:00
Brown
fd4ced42a7 Don’t register new assignment inside isset expr 2020-07-31 12:44:01 -04:00
Brown
82a85791f2 Fix #3764 - preserve sealed-ness of array into array_map 2020-07-07 09:31:43 -04:00
Brown
70ab4c18f4 Fix #3720 - allow literal unions in keys to map to object-like arrays 2020-07-01 18:57:19 -04:00
Matthew Brown
1d17c02fba Fix #3442 - support broader type after initial array assignment 2020-05-23 23:23:50 -04:00
Brown
813302206a Improve rendering of tuples 2020-05-11 09:08:53 -04:00
Brown
68cdbda8c7 Fix test 2020-04-18 13:19:25 -04:00
Brown
7dfa37beb2 Improve ergonomics of array assignment 2020-04-11 17:50:24 -04:00
Brown
bd92ec6cd3 Detect nested issues 2020-04-09 10:42:54 -04:00
Brown
bd2104c5ba Merge with mixed in nested arrays 2020-04-09 09:27:21 -04:00
Brown
b2e010b431 Fix #3102 - identify issues with possibly-mixed output 2020-04-08 14:07:09 -04:00
Brown
f6759c3d16 Check return statement types for inherited docblocks 2020-03-24 17:59:48 -04:00
Matthew Brown
b01bc9ab12 Fix union-of-mixed array key creation 2020-02-22 21:13:14 -05:00
Matthew Brown
4dae5b3190 Prevent more mixed array keys 2020-02-22 20:52:39 -05:00
Matthew Brown
6ad3d039df Prevent more array<mixed,...> creation 2020-02-22 12:12:40 -05:00
Brown
c77f2cd7a2 Treat array key int literals same way we treat string literals 2020-01-14 10:40:16 -05:00
Matthew Brown
85966d8a21 Fix #2577 - fix list cast to array 2020-01-11 11:42:09 -05:00
Matthew Brown
af28d650f3 Fix #2408 - existing offsets checked with isset should be valid 2019-12-18 23:48:25 +00:00