1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-15 10:57:08 +01:00
Commit Graph

204 Commits

Author SHA1 Message Date
Brown
067104e170 Fix #3084 - keep track of upper and lower bounds of inferred template types 2020-04-07 00:13:56 -04:00
Brown
6b25b33d81 Revert "Stub out str_replace types"
This reverts commit 94fefde376.
2020-04-04 17:38:34 -04:00
Brown
94fefde376 Stub out str_replace types 2020-04-04 11:05:13 -04:00
Brown
c0e573ab6a Try harder to understand templated array_map callable array
Fixes #3039
2020-04-03 16:53:56 -04:00
Brown
72104a52ad Improve file invalidation when using --diff mode 2020-04-02 17:18:04 -04:00
Matthew Brown
47c1470e3b Refactor reference checks to use more appropriate properties 2020-03-28 16:30:56 -04:00
Brown
971ae50bea Do prep work for #3024 - improve handling of absent class references 2020-03-26 12:35:27 -04:00
Matthew Brown
68c95c622a Save information about last runs whether or not there were errors 2020-03-26 00:46:39 -04:00
Brown
1e480ade12 Fix bugs 2020-03-24 14:49:05 -04:00
Brown
cae15b6c62 Use appropriate template types when applying array_filter asssertions
Fixes #3008
2020-03-24 12:15:56 -04:00
Matthew Brown
89a3af54a6 Add slash 2020-03-18 21:53:44 -04:00
Matthew Brown
9e29f6107a Add extra vendor check 2020-03-18 20:21:02 -04:00
Matthew Brown
afe25257da Don’t cache files not in project directories 2020-03-18 19:54:48 -04:00
Pavel Batečko
48af534270
Improve parse_url() return type (#2955) 2020-03-18 15:17:24 -04:00
Matthew Brown
43189b3d55 Allow types to be traversed 2020-03-14 23:54:51 -04:00
Matthew Brown
0aca01faea Improve fix to #2805 2020-03-14 01:09:12 -04:00
Matthew Brown
10b807b4f6 Fix reference generation from methods in --diff mode 2020-03-06 13:02:34 -05:00
Matthew Brown
f44c3488eb Keep track of which arg a given template was assigned from
Fixes #2900 - We only care about the depth of a templated match when templating from a particular argument. The next argument should essentially start afresh
2020-03-01 12:27:18 -05:00
Jacob Dreesen
038e7c9ff8 Change return type of range() from array<int, ...> to list<...> 2020-03-01 10:56:27 -05:00
Matthew Brown
e0d555e203 Allow function names to passed in as strings for callable template resolution 2020-02-29 15:43:45 -05:00
Matthew Brown
9bdca3c706 Forbid array<mixed, ...> 2020-02-21 01:26:51 -05:00
Matthew Brown
196a0a5c4e Replace issue data array with object 2020-02-16 18:24:40 -05:00
Matthew Brown
653353709a Use MethodIdentifier object instead of string 2020-02-14 20:54:26 -05:00
Brown
1c42875179 Support lowercase-string and warn about unnecessary calls to strtolower 2020-02-13 16:38:58 -05:00
Brown
f141f7c526 Improve --diff checks by including trait-using classes in dependents 2020-02-11 16:39:33 -05:00
Matthew Brown
074780547d Fix #2780 - filter int on more values 2020-02-09 23:58:37 -05:00
Matthew Brown
14f8fb8ecd Fix two redundant asserts 2020-02-09 11:45:43 -05:00
Brown
b46f219c51 Do better inference for array_map return type 2020-01-30 17:43:13 -05:00
Matthew Brown
5eb2ebc508 Add more type-system protections for bad array args 2020-01-29 23:41:17 -05:00
Matthew Brown
ce0298acc4 Fix #2704 - array_merge should ignore possibly-false issues where applicable 2020-01-29 21:09:33 -05:00
Matthew Brown
24e1d5446c Fix #2642 - merging two explicit lists is still a list 2020-01-17 09:31:08 -05:00
Alexander Wühr
f9560009ca Allow false as \PDO::fetch return type (#2647) 2020-01-17 08:48:08 -05:00
Brown
1b551b805b Fix #2627 - infer arrow function effects for array_filter 2020-01-15 11:40:49 -05:00
Brown
eb7c3dcc11 Fix #2611 - fix combination of inferred closure return types 2020-01-13 10:23:58 -05:00
Mark A. Hershberger
fbc2c21c9b bug: #2103 -- throw error if directories are given instead of file (#2605)
* bug: #2103 -- throw error if directories are given instead of file

* use global is_dir
2020-01-12 10:53:12 -05:00
SignpostMarv
9b2ceba2db removing trailing comma in function call, not detectable by php-cs-fixer re: FriendsOfPHP/PHP-CS-Fixer#4135 (#2597) 2020-01-11 16:00:38 -05:00
Matthew Brown
bd846123ce Fix #2560 - handle special case of array_filter on single-element array 2020-01-11 11:54:29 -05:00
Matthew Brown
40406c7ff0 Fix #2576 - remove literal key values if array_filter has no args 2020-01-11 11:48:22 -05:00
Dusk
63dea52e76 Add support for most PDOStatement fetch modes (#2553)
Flags like PDO::FETCH_CLASSTYPE and PDO::FETCH_PROPS_LATE aren't
supported yet.

(in re. #2529)
2020-01-06 16:41:52 -05:00
Matthew Brown
9fa2db1b6c Move Union::getTypes to Union::getAtomicTypes 2020-01-04 12:20:26 -05:00
Matthew Brown
8f504f9664 Fix style 2019-12-30 16:42:34 -05:00
Matthew Brown
ec292f58dc Move explode handling into its own file 2019-12-30 16:39:37 -05:00
Matthew Brown
53a2f77d00 Add better return type provider for PDO statement
Fixes #2529
2019-12-30 11:34:24 -05:00
Matthew Brown
55c2f7faa2 Fix #2508 - don’t replace templated types with generic ones inside own function 2019-12-28 18:38:02 -05:00
Matthew Brown
9a04d93cf9 Fix #2352 - treat hexdec return type a bit better 2019-12-27 14:14:49 -05:00
Matthew Brown
2f2cd85a6a Identify invalid static property array assignment 2019-12-27 10:34:51 -05:00
Matthew Brown
456aa1c569 Fix #2468 - add support for zipping arrays 2019-12-18 18:14:02 +00:00
Matthew Brown
529efaa29c Fix #2473 - allow array_map to work with callables returning static 2019-12-15 19:55:20 -05:00
Matthew Brown
7cb021a268 Fix the fix 2019-12-15 14:11:24 -05:00
Matthew Brown
1d0ac3df29 Fix #2472 - array_map should retain non-emptiness when passed string callables 2019-12-15 14:06:12 -05:00
Brown
05783eb616 Find issues with impossible property values 2019-12-11 17:08:02 -05:00
Matthew Brown
02fbf12337 Only warn about clauses in the currently-scanned conditional 2019-12-08 16:35:56 -05:00
Matthew Brown
d1fbd1fa26 Add working arrow-functions implementation 2019-11-26 23:52:26 -05:00
Brown
90cb3f4472 Speed up accessing node data
Ref #1837
2019-11-26 17:48:47 -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
0bcb7863f3 Use better system for storing inferred types and assertions 2019-11-25 11:44:54 -05:00
Brown
e7330afe8b Fix #2295 - support special case of array_shift on known offset type 2019-11-04 09:21:13 -05:00
Matthew Brown
7c4c78f67e Fix #2271 - treat array_replace same as array_merge 2019-11-02 10:15:03 +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
Matthew Brown
5918278af3 Fix cache growth thanks to array_recursive 2019-10-11 20:17:07 -04:00
Matthew Brown
1a1b3a10a9 Fix #2225 - iterator_to_array can return a list 2019-10-10 23:47:11 -04:00
Brown
50e729a6d1 Fix more list issues 2019-10-09 13:42:39 -04:00
Brown
b75720c32b Add more list types 2019-10-09 10:04:34 -04:00
Matthew Brown
51cfd556d6 Add non-empty-list support 2019-10-08 22:53:55 -04:00
Matthew Brown
d7007c3b76 Fix casing 2019-10-08 22:25:15 -04:00
Matthew Brown
38de68f507 array_values should preserve array non-emptiness 2019-10-08 22:22:58 -04:00
Brown
db33efb3e8 Fix another bad comma 2019-10-08 19:13:04 -04:00
Brown
23fcbec584 Add a few more list types 2019-10-08 19:06:16 -04:00
Brown
573b6bfe67 Remove bad comma 2019-10-08 18:51:44 -04:00
Brown
16c33d1565 Add support for list type
Fixes #2209
2019-10-08 18:44:46 -04:00
Brown
d225374d6d Fix #2156 - do better inference after isset 2019-10-01 19:31:08 -04:00
Brown
f8f8b633b1 Suppress a bunch of PossiblyUndefinedArrayOffset issues 2019-10-01 15:44:43 -04:00
Matthew Brown
a5f79353ed Fix #2157 - don’t merge closures and callable params 2019-09-22 00:58:30 -04:00
Matthew Brown
d387a1966c Fix array_slice return type 2019-09-21 15:50:37 -04:00
Matthew Brown
c5f62d261d Remove redundant @psalm-suppress in Psalm’s codebsae 2019-08-18 16:10:12 -04:00
Matthew Brown
d3f924a49e Fix #2004 - remove useless unset 2019-08-11 17:17:03 -04:00
Matthew Brown
5583ae842e Refactor signature selection a little 2019-07-18 23:08:54 -04:00
Brown
7268558aa7 Prevent unnecessary warnings 2019-07-11 11:07:39 -04:00
Brown
976d3bf787 Create cache directory if it doesn’t exist 2019-07-11 10:46:12 -04:00
Matthew Brown
da42be175f Apply PHPCS fixes
Fixes #1880
2019-07-05 16:27:53 -04:00
Tyson Andre
af52ad245a Remove unused variables (#1898) 2019-07-04 15:17:28 -04:00
Ilija Tovilo
67c3726254 Implement signature help - closes #1841 (#1862)
* Implement signature help - closes #1841

* Add explicit signature count

* [LSP] Do analysis for every signatureHelp request

See here: https://github.com/vimeo/psalm/pull/1862#issuecomment-507007346

* Don’t language server information when checking property for init

* Fix signature help for functions

* Add try-catch around signature help Functions::getStorage()
2019-07-01 15:54:32 -04:00
Matthew Brown
ca53019d6b Simplify class completion lookup
Ref #1822
2019-06-29 21:32:26 -04:00
Matthew Brown
6b7788b502 Fix FileAnalyzer memory leak 2019-06-29 21:06:21 -04:00
Teemu Koskinen
0568a471de Fix MethodParamsProvider to accept an empty array (ie. no params) from MethodParamsProviderInterface (#1854) 2019-06-27 11:51:56 -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
aa6677a177 Add autocompletion for some classes
Ref #1822
2019-06-21 17:10:35 -04:00
Brown
c93c2a4843 Don’t modify AST when analyzing array_filter 2019-06-20 14:14:48 -04:00
Brown
84e002e9a7 Fix #1816 - convert array_filter strings to full closures 2019-06-19 17:42:42 -04:00
Matthew Brown
2d5f332ebf Fix #1781 by improving handling of callmap options 2019-06-15 16:10:48 -04:00
Brown
844442e039 Fix #1780 - set open file contents on save 2019-06-13 15:25:55 -04:00
Matthew Brown
c0a9ccb385 Fix handling of unused params in threaded mode 2019-06-09 17:02:21 -04:00
Marco Pivetta
624c7bc6fb Renamed Fn to TFn to allow for PHP 7.4 compatibility 2019-06-03 08:21:25 -04:00
Ilija Tovilo
5a14e4b1cf Progress bar (#1709)
* Revert "Revert "Implement better progress""

This reverts commit 4302596654.

* Revert "Revert "Implement dots progress bar""

This reverts commit e41733d789.

* Revert "Revert "Switch to VoidProgress by default""

This reverts commit 304ffeb0a3.

* Revert "Revert "Pass success flag to progress""

This reverts commit 62a690ee4e.

* Improve socket communication

* Use an underscore

* Add means to disable progress

* Add extra newline before progress bar
2019-05-30 10:30:41 -04:00
Matthew Brown
c5e682d312 Fix #1696 - decrease memory usage by keeping parser 2019-05-27 13:14:50 -04:00
Matthew Brown
4302596654 Revert "Implement better progress"
This reverts commit 042070d0fd.
2019-05-27 13:07:02 -04:00
Matthew Brown
304ffeb0a3 Revert "Switch to VoidProgress by default"
This reverts commit 63b46be361.
2019-05-27 13:04:38 -04:00
Ilija Tovilo
63b46be361 Switch to VoidProgress by default 2019-05-26 23:18:48 -04:00
Ilija Tovilo
042070d0fd Implement better progress 2019-05-26 23:18:48 -04:00