1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-12 09:19:40 +01:00
Commit Graph

279 Commits

Author SHA1 Message Date
Bruce Weirdan
7d3dd47efa Added support for preg_grep (#2523) 2019-12-29 11:05:08 -05:00
Valentin Udaltsov
006f788d6a Added array_fill_keys support (#2512)
* Added array_fill_keys support

* Removed unnecessary array_fill_keys phpdoc
2019-12-27 13:30:42 +00:00
Matthew Brown
456aa1c569 Fix #2468 - add support for zipping arrays 2019-12-18 18:14:02 +00:00
Matthew Brown
1d0ac3df29 Fix #2472 - array_map should retain non-emptiness when passed string callables 2019-12-15 14:06:12 -05:00
Matthew Brown
432c291dd7 Fix #2440 - add support for uasort 2019-12-08 21:30:19 -05:00
Valentin Udaltsov
4a742f9940 Added array_key_first and array_key_last stubs (#2381) 2019-11-27 10:59:12 -05:00
Matthew Brown
113bf921f6 Add support for arrow function inference 2019-11-27 10:12:59 -05:00
Pavel Batečko
4e594e0a65 Improve array function list handling (#2377)
* array_column() returns a list unless the 3rd arg is passed

* array_pad() return type provider

* array_chunk() return type provider

* array_map() preserve list types
2019-11-26 14:48:49 -05:00
Brown
5e17a9af10 Fix #2348 - ensure all functions and methods return some type 2019-11-14 14:44:29 -05:00
Joram Schrijver
c97ba8f713 Implement type-checking and forbidding for print (#2314)
* Add type-checking for print

* Allow print to be forbidden
2019-11-08 07:01:34 -05:00
Brown
e7330afe8b Fix #2295 - support special case of array_shift on known offset type 2019-11-04 09:21:13 -05:00
Pavel Batečko
b229ac875d Improve return types of explode() with limit (#2286) 2019-11-02 10:10:38 +01:00
Matthew Brown
05ace25817 Fix #2246 - fix return type of array_slice to be a list 2019-10-20 16:19:01 -04:00
Matthew Brown
b476761109 Fix #2235 - improve behaviour of array_merge on lists 2019-10-20 15:47:00 -04:00
lhchavez
216f991b0c Normalize stringified type names (#2239)
This change makes stringified types more normalized. Concretely it sorts
all union types, reconciled types, and sorts the keys within object-like
types.
2019-10-17 01:14:33 -04:00
Matthew Brown
1a1b3a10a9 Fix #2225 - iterator_to_array can return a list 2019-10-10 23:47:11 -04:00
Brown
ead2e38985 fix test 2019-10-09 13:51:25 -04:00
Matthew Brown
6a07757b9a Fix tests 2019-10-08 22:41:23 -04:00
Brown
16c33d1565 Add support for list type
Fixes #2209
2019-10-08 18:44:46 -04:00
Guuzen
50df2868f2 Fix issue #2201 (#2212) 2019-10-06 15:28:41 -04:00
Jay Klehr
27961045a0 allowing null as type for mysqli real_connect for host and passwd parameters (#2210) 2019-10-04 13:07:28 -04:00
Matthew Brown
2ffdf1bacc Fix undefined numeric offset 2019-10-01 08:45:36 -04:00
Matthew Brown
d387a1966c Fix array_slice return type 2019-09-21 15:50:37 -04:00
Brown
944531b73b fix #2125 - Don’t assume function args are necessarily authoratative 2019-09-11 13:52:58 -04:00
Matthew Brown
6b52b84bee Fix #2101 - use more accurate fallback when match isn’t found 2019-09-08 14:44:59 -04:00
Matthew Brown
03f59ae05e Check other arguments of array_unshift/array_push
Ref #2052
2019-08-25 23:52:38 -04:00
Pavel Batečko
3e549e275b Type $matches as an array if non-zero flags are passed to preg_match() (#2022)
* Type $matches as an array if non-zero flags are passed to preg_match()

* Add tests for preg_match() function call
2019-08-15 10:28:03 -04:00
Brown
58b6d8bed4 Fix #2012 - count(callable-array) is fine and always equals 2 2019-08-12 16:17:55 -04:00
Matthew Brown
de932c4c18 Fix #1972 - improve understanding of how setcookie works 2019-07-28 16:40:35 -04:00
Brown
5770a6c904 Add support for compact 2019-07-24 17:24:23 -04:00
Brown
59dd6393f5 Fix #1953 - support third arg for explode 2019-07-17 14:13:34 -04:00
Matthew Brown
da42be175f Apply PHPCS fixes
Fixes #1880
2019-07-05 16:27:53 -04:00
Matthew Brown
aa3df3f7a5 Add better support for preg_replace_callback 2019-07-05 10:40:05 -04:00
Matthew Brown
220fa31404 Fix suppression 2019-06-30 11:14:05 -04:00
Brown
5943f6036e Fix #1859 - allow function_exists introspection when function exists 2019-06-28 10:48:30 -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
Matthew Brown
c66a106622 Improve performance by doing less cloning
Ref #1837
2019-06-26 00:14:06 -04:00
Brown
84e002e9a7 Fix #1816 - convert array_filter strings to full closures 2019-06-19 17:42:42 -04:00
Matthew Brown
7155ed4e06 Fix #1811 - improve expected argument count 2019-06-19 09:05:07 -04:00
Matthew Brown
a553adb232 Fix test array spacing 2019-06-16 09:42:34 -04:00
Matthew Brown
2d5f332ebf Fix #1781 by improving handling of callmap options 2019-06-15 16:10:48 -04:00
Brown
c81a9a8737 Fix #1742 - allow is_countable assertion to mean something 2019-06-07 15:49:10 -04:00
Brown
29eda50ed9 Fix #1716 - no notice when using single arg in min 2019-06-03 10:33:54 -04:00
Matthew Brown
4002504ff0 Allow trait_exists to inform type for ReflectionClass 2019-05-31 09:43:46 -04:00
Matthew Brown
e31cdf3be5 Fix #1701 - allow count to be called on SimpleXMLElement 2019-05-29 07:56:06 -04:00
Brown
a89892a41f Prevent more broad template types being captured 2019-05-28 11:54:07 -04:00
Brown
29c869ed67 Ignore nullable issues on just-coerced types 2019-05-21 12:59:06 -04:00
Brown
4ecf370900 Coerce mixed values when passed as arguments 2019-05-21 11:51:41 -04:00
Lars Moelleken
0b5680f72f fix return type of "array_combine()" && "array_replace()" 2019-05-12 19:37:46 -04:00
Brown
d7ee952084 Infer closure param type for array_filter/array_map
Fixes #664
2019-05-07 16:27:25 -04:00
Brown
0e4c8ce482 Split apart TypeCoercion issues, allowing more granular issue filtering 2019-04-25 18:02:19 -04:00
Brown
97f53a6486 @voku’s fixes for issues found by their callmap update 2019-04-11 11:02:46 -04:00
Brown
1a33b25264 Fix #1536 - prevent fatal error when filtering null array 2019-04-09 17:22:30 -04:00
Brown
5173c18cce Fix calls after updating callmap 2019-04-09 16:52:32 -04:00
Brown
3dc3d659f1 Fix #1534 - allow unpacked args to be interpreted properly by overloaded functions 2019-04-09 14:48:51 -04:00
Brown
41c722448a Fix #1531 - improve hrtime return type 2019-04-03 17:08:37 -04:00
Brown
f82a55d836 Fix #1512 - check args to mktime are all ints 2019-03-29 10:46:48 -04:00
Matthew Brown
c772914910 Add some formatting 2019-03-23 14:27:54 -04:00
Matthew Brown
f0ddc6f3bc Fix array_reverse implementation 2019-03-17 18:14:30 -04:00
Brown
441d3c4693 Fix #1470 - array_reverse should preserve count 2019-03-15 16:39:31 -04:00
Matthew Brown
82e6876011 Fix #1397 - fix get_class behaviour for new instances 2019-03-02 18:02:11 -05:00
Bruce Weirdan
9bdc9f774f More provider typing 2019-03-02 08:43:19 -05:00
Brown
601f303de2 Fix position of invalid param 2019-02-27 16:00:44 -05:00
Matthew Brown
3d4710c9d3 Add better checks for invalid array_map/array_filter args 2019-02-22 00:50:41 -05:00
Brown
41b133178a Improve handling of count comparisons 2019-02-21 17:17:10 -05:00
Brown
b7a0950aea Prevent passing casts to byref vars 2019-02-21 13:26:37 -05:00
Brown
079ac44263 Prevent pass by ref when type type is given 2019-02-20 17:43:12 -05:00
Matthew Brown
75104f4712 Fix #1359 - error on bad iterable args 2019-02-18 16:35:23 -05:00
Matthew Brown
c58100e3af Fix #1313 - don’t allow mixed function calls 2019-02-10 16:15:52 -05:00
Matthew Brown
c383e61805 Fix #1296 - array_filter should allow scalar values 2019-02-07 13:05:17 -05:00
Matthew Brown
17541b415f Fix #1191 - allow Psalm to check against different versions of PHP 2019-02-07 12:25:57 -05:00
Matthew Brown
f8f5ddfb04 Add support for string range 2019-02-07 10:50:42 -05:00
Brown
9edbae2bdc Fix possible fatal when builtin function is called in array_filter 2019-01-28 17:54:50 -05:00
Brown
f33415827e Add checks for rounded values 2019-01-28 11:57:49 -05:00
Matthew Brown
cd4d2027d0 Fix #1249 - allow iterator_to_array to respect getIterator method 2019-01-27 14:50:05 -05:00
Brown
184ee76176 Remove erroneous regular namespace check
Fixes #1235
2019-01-24 10:41:06 -05:00
Matthew Brown
99569e8ee3 Fix #1173 - transform const X = true to a true type 2019-01-21 16:55:50 -05:00
Matthew Brown
1c17d2e2f2 Extract template params from string/array callables cc @weirdan
The culmination of what you were getting at
2019-01-19 20:18:45 -05:00
Matthew Brown
ed68cb973d Fix #1109 - add bad usort protection 2019-01-19 18:11:49 -05:00
Brown
8d61cb4816 Fix #1200 - no fatal error in array_map when not checking functions 2019-01-15 17:53:23 -05:00
Matthew Brown
214fd7d461 Add DuplicateFunction issue
Fixes #49
2019-01-06 16:40:44 -05:00
Matthew Brown
43b4c1c0a3 Fix #1168 - better return type for range 2019-01-06 13:02:46 -05:00
Matthew Brown
c7723df8ff Allow gettype vars to be compared to strings 2019-01-05 16:23:18 -05:00
Matthew Brown
f5378bdca8 Improve function call resolution 2019-01-05 14:50:11 -05:00
Matthew Brown
9d8c2792e2 Add array-key type and improve general type handling
Fixes #1144
2019-01-05 00:15:53 -05:00
Matthew Brown
2dc3d9651f Separate iterable into its own type
Fixes #1151
2019-01-04 14:54:40 -05:00
Andrii
36f6930e0c 🐛 #1163 Fix handling for default option in filter_var 2019-01-02 13:27:53 -05:00
Matthew Brown
c4d024a72d Check variable static calls
Fixes #1142 and #1160
2019-01-02 09:00:45 -05:00
Matthew Brown
901596281c Fix #1143 - check some variable new calls 2019-01-02 06:58:49 -05:00
Brown
fb848d62e9 Add checks for if (count($a)) and if (count($a) [operator] [number]) 2018-12-19 16:15:19 -05:00
Matthew Brown
ea89a6ba29 Revert "First pass"
This reverts commit 9ed047234f.
2018-12-19 08:45:14 -05:00
Matthew Brown
20f7147af1 Revert "Maybe bad idea"
This reverts commit 03c817be08.
2018-12-19 08:44:56 -05:00
Matthew Brown
03c817be08 Maybe bad idea 2018-12-19 01:59:26 -05:00
Matthew Brown
9ed047234f First pass 2018-12-19 01:59:14 -05:00
Matthew Brown
f0969cb3bb Fix getId calls on callable return types
Ref #1119
2018-12-08 14:10:06 -05:00
Matthew Brown
6ef79a0432 Improve handling of byref vars passed into functions
Fixes #1066
2018-11-21 12:38:51 -05:00
Brown
dc834fdb01 Default allowStringToStandInForClass to true and fix errors found 2018-11-12 12:03:55 -05:00
Matthew Brown
4688b25fd9 Move internal classes to own namespace 2018-11-12 11:20:59 -05:00
Brown
b7099aaf3f Make sure array changes are noticed 2018-11-09 11:19:44 -05:00
Brown
496018f84a Fix #1024 - add support for filter_var 2018-10-23 14:38:36 -04:00