1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-14 10:17:33 +01:00
Commit Graph

130 Commits

Author SHA1 Message Date
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
Matthew Brown
790bc53bfd Fix #1681 - interpret parent annotation properly 2019-05-25 11:51:09 -04:00
Josh Di Fabio
d37cddea27 FileProvider: Consider file open if temp changes
The VS Code LSP client does not always send didOpen messages when a file
is being edited. This causes code completion requests to fail because the
completion request refers to files which are not 'open' according to
FileProvider.

This commit changes FileProvider so that a file is considered 'open' if it is
being modified, even if no didOpen message was received from the LSP
client.
2019-05-17 11:27:45 -04:00
Brown
ebe97c871e Make tests much faster 2019-05-17 11:22:34 -04:00
Brown
0bd4dbcbc4 Bump to PHP 7.1
Fixes #1650
2019-05-16 18:36:36 -04:00
Ramon Bakker
6a473f6e71 Fix isset check
Check if index exists in the array with open files, instead of checking
if index exists in the array with temporary files.
2019-05-09 08:31:16 -04:00
Brown
1db0e38b08 Invalidate cache when Psalm version changes 2019-05-08 11:58:34 -04:00
Brown
b6e9fba8e6 Track method param uses between diff runs 2019-04-29 17:29:38 -04:00
Matthew Brown
b4f24d1fa6 Fix a couple of tests, and track file references to classes 2019-04-28 12:59:36 -04:00
Matthew Brown
2ae0f92960 Store files-referencing-classes between runs to enable unreferenced code --diff mode 2019-04-28 12:36:24 -04:00
Matthew Brown
e08944cae0 Allow diff mode with --find-dead-code 2019-04-27 17:38:24 -04:00
Brown
ff14f671b1 Add hopefully-more-portable method for evaluating method/property usage 2019-04-16 16:07:48 -04:00
Matthew Brown
d145f17782 Fix #1548 - allow parallel execution with --find-dead-code 2019-04-13 15:38:09 -04:00
Brown
26e2de93c7 Prepare to enable paralellised use of --find-dead-code
References #1548
2019-04-12 18:28:07 -04:00
Brown
be5a262deb Add better handling for non-edge-case function calls 2019-04-11 14:53:21 -04:00
Brown
1a33b25264 Fix #1536 - prevent fatal error when filtering null array 2019-04-09 17:22:30 -04:00
Brown
115b68dc70 Fix #1526 - add a proper check for file storage 2019-04-03 17:41:33 -04:00
Brown
21b1c04c1d Fix #1526 - ignore files if they weren’t picked up in scanning step 2019-04-03 10:43:48 -04:00
Brown
1ab6345bac Fix treatment of PDOStatement::setFetchMode
Fixes #1496
2019-03-29 13:26:13 -04:00
Brown
f82a55d836 Fix #1512 - check args to mktime are all ints 2019-03-29 10:46:48 -04:00
Matthew Brown
ee56419fd6 Improve accuracy and durability of mixed counts 2019-03-23 09:50:47 -04:00
Matthew Brown
f0ddc6f3bc Fix array_reverse implementation 2019-03-17 18:14:30 -04:00
Bruce Weirdan
51460e6078 Codebase::classExtends() now rejects unpopulated classes
This is done to prevent false negatives, when class storage hasn't been
populated yet.

Fixes vimeo/psalm#1387
2019-03-17 13:51:00 -04:00
Matthew Brown
01d6caf6a2 Catch negated instanceof bugs 2019-03-16 12:34:48 -04:00
Brown
441d3c4693 Fix #1470 - array_reverse should preserve count 2019-03-15 16:39:31 -04:00
Brown
85f34f2aca Add defining class and increas string length 2019-03-12 12:58:04 -04:00
Brown
e5f7a5a4bc Coerce class string types together 2019-03-08 17:35:09 -05:00
Brown
5beb26659e Add special type for SQL select strings for plugins to consume 2019-03-07 14:56:18 -05:00
Tyson Andre
6f7295ed13 Remove unused use statements 2019-03-03 22:22:36 -05:00
Matthew Brown
317f790bde
New plugin hooks (#1405)
* Add a bunch of new hooks

* Add more integrations

* Add some broken tests

* Add more things

* Fix remaining interfaces

* Suppress proper issue

* UndefinedMethod should not stop analysis

* Add handlers for two custom method return types
2019-03-01 08:57:10 -05:00
Matthew Brown
ee942b3c02 Fix return type 2019-03-01 00:06:35 -05:00
Brown
815bf845dc Improve handling of method/function return types 2019-02-27 17:06:44 -05:00
Matthew Brown
cdae79b9fe Fix unnecessary params in Psalm codebase 2019-02-23 11:31:33 -05:00
Matthew Brown
6b045236e0 Use appearing method for array lookup 2019-02-20 02:41:59 -05:00
Matthew Brown
cd2eb3edb9 Fix #1361 - flesh out array map return type before using 2019-02-19 01:25:36 -05:00
Bruce Weirdan
8408effe57 Dropped unused uses 2019-02-17 13:17:45 -05:00
Matthew Brown
2ef82d785f Improve signature of FunctionReturnTypeProvider to omit internal things 2019-02-16 15:29:54 -05:00
Matthew Brown
0739d017ac Use information from .phpstorm.meta.php files in stubs 2019-02-16 11:16:52 -05:00
Matthew Brown
d5420a7708 Suppress PossiblyUnusedParam for PHP 7.0 2019-02-15 18:50:23 -05:00
Matthew Brown
0c9c8c204c Suppress UndefinedMethod for Php 7.0 Psalm check 2019-02-15 18:41:30 -05:00
Matthew Brown
149d7cab1c Add PHP 7.0-compatible closure creation 2019-02-15 18:33:29 -05:00
Matthew Brown
d76459e138 Move to a PHPStan-like return type provider class model 2019-02-15 18:00:40 -05:00
Matthew Brown
90dc39c296 Don’t preserve old storages when receiving worker data
This bug was found when running Psalm in threaded execution mode
2019-01-15 23:24:29 -05:00
Brown
f108badd03 Fix #1067 - add support for @template-extends 2019-01-10 16:59:44 -05:00
Brown
974476dc87 Fix var used to assert length 2018-12-20 17:34:56 -05:00
Brown
abdf646050 Only diff files if lengths are not very different 2018-12-20 17:33:35 -05:00
Matthew Brown
aee5639a4c Remove @internal annotation from FileProvider because PHPUnit 6 can’t deal 2018-12-01 19:06:24 -05:00
Matthew Brown
b32000fa05 Fix #689 - add checks for @internal annotations 2018-12-01 18:37:49 -05:00
Brown
f5e788ec1f Increase limits of literal strings to 50 characters 2018-11-27 17:48:23 -05:00
Matthew Brown
f35a550774 Remove redundant clause 2018-11-20 22:24:53 -05:00
Matthew Brown
740aa895e9 Fix #1074 - allow switching from Phar analysis to regular analysis 2018-11-20 22:21:00 -05:00
Brown
b5f0159cdf Add backup hover analysis when file isn’t analysed 2018-11-20 16:32:40 -05:00
Brown
ca602f8e17 Fix language server crash after editing trait method names 2018-11-20 15:51:47 -05:00
Matthew Brown
4d79b61e93 Change _checker to _analyzer 2018-11-12 11:20:59 -05:00
Matthew Brown
4688b25fd9 Move internal classes to own namespace 2018-11-12 11:20:59 -05:00