1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00
Commit Graph

41 Commits

Author SHA1 Message Date
Matt Brown
5da816f160
Ensure getId() output can always be parsed as a type
Ref #5105
2021-01-29 11:47:36 +01:00
Matt Brown
e67315424f
Fix #4917 - allow array_reduce to be called with a single arg 2021-01-29 11:47:27 +01:00
Matt Brown
f8e22ab7ac
Break out array_key_exists tests 2021-01-29 11:47:12 +01:00
orklah
0df867cdff
fix array_column with possibly_undefined keys (#4719) 2021-01-29 11:47:03 +01:00
Matt Brown
3ebdb3b952
Use more accurate comparison for non-empty-lists 2021-01-29 11:44:34 +01:00
Matt Brown
78380c591b
Fix #4274 - don’t ignore mixed union in array_shift operation 2021-01-29 11:39:53 +01:00
orklah
9f00b8536a
fix test on windows (#4225) 2021-01-29 11:39:40 +01:00
Brown
ff2c18aa67
Fix #4208 - array with possibly-undefined keys isn‘t really sealed 2021-01-29 11:39:38 +01:00
Brown
7e534d14d0
Improve accuracy of array_filter 2021-01-29 11:39:37 +01:00
Brown
f8e7b649c7
Improve array_merge return type 2021-01-29 11:39:37 +01:00
ygottschalk
c361f86c68
added array-size max constraint to greater check (#4175)
added a few unit tests
2021-01-29 11:38:58 +01:00
Brown
5d04368d98
Fix #4169 - add appropriate bounds check 2021-01-29 11:38:57 +01:00
orklah
db45ff1ba4
More return types (#4173)
* add native return types

* redundant phpdoc
2021-01-29 11:38:57 +01:00
Brown
c96ba8d1f5
Add some backwards-incompatible changes for 4.x 2021-01-29 11:38:48 +01:00
Brown
02255ae26b
Fix #4077 - always track closure purity 2021-01-29 11:38:47 +01:00
Bruce Weirdan
dabfb16e34
Test parallelization (#4045)
* Run tests in random order

Being able to run tests in any order is a pre-requisite for being able
to run them in parallel.

* Reset type coverage between tests, fix affected tests

* Reset parser and lexer between test runs and on php version change

Previously lexer was reset, but parser kept the reference to the old
one, and reference to the parser was kept by StatementsProvider. This
resulted in order-dependent tests - if the parser was first initialized
with phpVersion set to 7.4 then arrow functions worked fine, but were
failing when the parser was initially constructed with settings for 7.3

This can be demonstrated on current master by upgrading to
nikic/php-parser:4.9 and running:

```
vendor/bin/phpunit --no-coverage --filter="inferredArgArrowFunction" tests/ClosureTest.php
```

Now all tests using PHP 7.4 features must set the PHP version
accordingly.

* Marked more tests using 7.4 syntax

* Reset newline-between-annotation flag between tests

* Resolve real paths before passing them to checkPaths

When checkPaths is called from psalm.php the paths are resolved, so we
just mimicking SUT behaviour here.

* Restore newline-between-annotations in DocCommentTest

* Tweak Appveyor caches

* Tweak TravisCI caches

* Tweak CircleCI caches

* Run tests in parallel

Use `vendor/bin/paratest` instead of `vendor/bin/phpunit`

* Use default paratest runner on Windows

WrapperRunner is not supported on Windows.

* TRAVIS_TAG could be empty

* Restore appveyor conditional caching
2021-01-29 11:38:04 +01:00
Bruce Weirdan
1cc4715740
Fix windows tests (#4040)
* Fix windows tests by not mangling the expectations

* Use platform-dependent directory separator in expected messages

* fix CS
2021-01-29 11:38:04 +01:00
Matthew Brown
5c20a5295e Improve solution to #3964 2020-08-16 13:03:30 -04:00
ygottschalk
f831ebdbcf
narrowed reset and end return type (#3950)
* narrowed `reset` return type
BUT psalm seems to ignore the stub

* narrowed `reset` and `end` return type, this time for real

* fixed UnusedVariable Issue

* fixed RedundantCondition Issue
caused by `end`s return type being more precise

* Improve solution slightly

Co-authored-by: Matthew Brown <github@muglug.com>
2020-08-07 12:23:20 -04:00
Brown
38bfc12b98 Fix array_shift behaviour to be more accurate with lists
Fixes #3941
2020-08-05 12:43:37 -04:00
Matthew Brown
ab64ccab88 Fix #3913 properly 2020-07-31 14:56:29 -04:00
Brown
962265e98e Hopefully final fixes 2020-07-21 23:59:11 -04:00
ygottschalk
de2109234d
fixes wrong return type of key() #3838 (#3839)
* fixes wrong return type of key() #3838
fixed/added tests for key

* fixed test again
2020-07-20 04:49:36 -04:00
Brown
06ee1b71c7 Improve check for empty array 2020-07-15 09:49:30 -04:00
Brown
0ab163fd78 Skip dodgy tests 2020-07-15 01:53:31 -04:00
ygottschalk
94e2552d1c
Fix #3810 removing ignore-nullable-return (#3817)
* Fix #3810 removing ignore-nullable-return form stubs of key, array_key_first, array_key_last

* fixed test failing due to changes to key()

* Improve key return type

* Remove unnecessary check

Co-authored-by: Matthew Brown <github@muglug.com>
2020-07-14 17:43:26 -04:00
Evgeniy
fcd2ac3078
array_column check result non-emptyness (#3813)
* Update

* Update test

* Fix test

* Fix test

* inline function res in test

* cs
2020-07-14 17:13:45 -04:00
Brown
27cb660377 Respect possibly-undefined array keys while merging
Fixes #3393
2020-05-19 20:10:01 -04:00
orklah
478bb267d8
stubs for array_sum (#3395) 2020-05-18 17:23:21 -04:00
Brown
111303d913 Add non-empty-lowercase-string type 2020-05-15 10:18:05 -04:00
Brown
813302206a Improve rendering of tuples 2020-05-11 09:08:53 -04:00
Brown
75761647c2 Fix #3321 - allow interface methods to be mapped 2020-05-08 14:52:53 -04:00
Brown
891c66650b Prevent unintersectable template lower bounds
Ref #3264
2020-04-29 14:57:57 -04:00
Grégoire Paris
1fb1c2195d
Allow non-string keys (#3221)
Although it would be stupid to provide an array with exclusively
non-string keys, it's possible to have an array with a bit of both.

See for instance
155d028be0/tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php (L263-L276)
2020-04-27 22:49:07 -04:00
Brown
ddbc1d2763 Yet again fix handling of nested template resolution and comparison 2020-04-18 13:02:55 -04:00
Matthew Brown
ecac9d56c0 Fix #3061 - prevent array_key_exists from completely changing type 2020-04-03 08:05:21 -04:00
Matthew Brown
5b4ed6b516 Fix #2942 - support array_splice properly for numeric-keyed arrays 2020-03-09 01:15:52 -04:00
Matthew Brown
d8b6467b1a Fix #2852 - no duplicatearraykey warning for non string-keyed arrays 2020-02-21 01:27:42 -05:00
Matthew Brown
5f4d797fe1 Fix #2772 - add support for multiple array_map function param inference 2020-02-08 12:17:57 -05:00
Brown
66227f9b7f Fix #2727 - callable arg checks should obey ignore_falsable_return 2020-01-31 13:58:56 -05:00
Brown
3d6c63bc08 Break apart FunctionCallTest 2020-01-31 13:58:02 -05:00