1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-14 02:07:37 +01:00
Commit Graph

91 Commits

Author SHA1 Message Date
Vincent Langlet
3339ce1379 Use stmt instead of args 2021-07-11 11:22:13 +02:00
Vincent Langlet
49ed7b045f Pass statement to MethodReturnTypeProviderEvent 2021-07-08 00:02:36 +02:00
Bruce Weirdan
6abce3525a
Enforce use sort (#5900) 2021-06-07 22:55:21 -04:00
Bruce Weirdan
80e8d40013
Deprecate legacy hook interfaces (#5898)
Refs vimeo/psalm#4700
2021-06-07 10:46:56 -04:00
Oliver Hader
e457a7d5af
[FEATURE] Allow plugins to declare their custom scanner or analyzer (#5883)
* [FEATURE] Allow plugins to declare their custom scanner or analyzer

Related: #5882

* [TEST] Check plugin declaring own scanner/analyzer

* [TASK] Document plugins declaring scanner or analyzer

* [TEST] Clean up code

* [!!!][TASK] Extend Psalm\Plugin\RegistrationInterface

* add method `addFileTypeScanner(string $fileExtension, string $className): void`
* add method `addFileTypeAnalyzer(string $fileExtension, string $className): void`

* [TASK] Ignore IntelliJ/PhpStorm workspace folder in VCS

* [TASK] Remove superfluous class import
2021-06-04 15:32:53 -04:00
Bruce Weirdan
105c6f3a1c
Remove (and prevent) unused uses (#5704)
* Updates `slevomat/coding-standard`
* Removes unused uses
* Prevents unused uses
* Fixes a number of symbol case mismatches
2021-05-03 17:22:15 -04:00
Matt Brown
72226c500a Add level to shepherd data 2021-03-27 22:24:38 -04:00
Matt Brown
15b0542260 Prevent more offset issues 2021-03-22 23:26:03 -04:00
Samuel Mortenson
4aabb411a8
Added event to prevent tainting. (#5398)
* Added event to prevent tainting.

* Remove optional codebase parameter.

* Removed falsy check for codebase.

* Use two separate hooks for adding and removing taints

* Add slashes

* Update add/remove taint test name.

* Cleaned up SafeArrayKeyChecker example plugin.

* Added more AddRemoveTaintsEvent calls to codebase.

* Fix type check error with $added_taints param.

* Added AddRemoveTaintsEvent to remaining classes.

* Fix post-merge error.

* Add comma

* Remove $int_offset that never existed

Co-authored-by: Matt Brown <github@muglug.com>
2021-03-19 22:41:41 -04:00
orklah
81e557e3a8
adds statements list in the event (#4835) 2021-01-07 09:04:50 -05:00
orklah
1bbcbddfcf
pass args through event (#4864) 2021-01-07 09:02:05 -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
1d9987e0ed
fix phpdoc (#4905) 2020-12-29 11:42:41 +00:00
orklah
09fb141e49
Document lowercase-string when possible (#4904)
* document lowercase-string

* fix missing strtolower
2020-12-29 11:42:12 +00:00
Matt Brown
4aef96bbac Use lists everywhere for args 2020-10-28 12:45:26 -04:00
orklah
ffe7874906
Misc improvements (#4314)
* extract the operation out of the loop when possible

* remove unnecessary interfaces when already inherited in parent

* simplify expressions

* avoid using alias functions

* redundant phpdoc

* unused imports
2020-10-15 13:23:35 -04:00
orklah
10f2966dcb
return types (#4311)
* return types

* remove willReturn for void methods
2020-10-12 15:02:52 -04:00
Matt Brown
5c2591f7b0 Make docblocks compatible with PHP 8 2020-10-12 11:21:53 -04:00
Matt Brown
ea47548dd0 4.x - Prevent AfterFunctionCallAnalysisInterface from rewriting return types 2020-10-04 23:39:20 -04:00
orklah
37a2f8a33d
unused use statements (#4228) 2020-09-22 01:10:46 -04:00
orklah
da47588f91
replace return; by return null; in every non-void method, add return null; when mising, add return types, remove redundant phpdoc (#4176) 2020-09-13 16:39:06 -04:00
orklah
ead107fa9e
More return types (#4173)
* add native return types

* redundant phpdoc
2020-09-12 11:24:05 -04:00
orklah
8c7423505a
add native param types (#4137)
* add native param types

* redundant phpdoc

* add more param types and adds "?" to nullable types

* remove redundant phpdoc

* add more param types and remove redundant phpdoc

* add more param types and remove redundant phpdoc
2020-09-06 19:36:47 -04:00
orklah
f66d57f19d
add native return types (#4116)
* add native return types

* remove redundant phpdoc
2020-09-04 16:26:33 -04:00
Brown
5905171b79 Fix api 2020-08-31 16:40:46 -04:00
Brown
64f08fa9dc Improve Closure::fromCallable handling 2020-08-29 22:02:58 -04:00
Matthew Brown
ef0486ce35 Add some pure annotations 2020-08-23 13:52:31 -04:00
Brown
966a3522ff Move words 2020-08-11 14:36:59 -04:00
feek
7fe7146dc3
docs: provide some background as to what certain hooks are for (#3978) 2020-08-11 07:29:45 -04:00
lhchavez
ab3016af6e
Fix File-related analysis plugin hooks (#3970)
This change does a few things:

* Renames `BeforeAnalyzeFileInterface` to `BeforeFileAnalysisInterface`.
* Adds a few more parameters to `BeforeFileAnalysisInterface`.
* Since the analysis was never called due to a bug, the above two
  changes are safe to do.
* Fix the above-mentioned bug, and now adds the hooks to the config.
* Update the documentation about the File-related analysis plugin hooks.
* Add a test to ensure that this does not break again in the future.

Fixes: #3969
2020-08-10 10:49:53 -04:00
Matthew Brown
50cc3a8afa Align paramter names 2020-08-09 23:19:59 -04:00
feek
d60ece752c
chore: mark as lowercase string (#3392) 2020-05-18 16:02:46 -04:00
Brown
111303d913 Add non-empty-lowercase-string type 2020-05-15 10:18:05 -04:00
feek
7dd1823c4c
fix: code location is nullable (#3334) 2020-05-10 21:12:10 -04:00
orklah
8571746f8a
Add hook for plugins after FunctionLikeAnalysis (#3258) 2020-04-28 15:30:51 -04:00
Matthew Brown
196a0a5c4e Replace issue data array with object 2020-02-16 18:24:40 -05:00
Philip Hofstetter
395cf587d3 add plugin hook to be called after every function call
compared to AfterFunctionCallAnalysisInterface which gets only called
after a call to a function declared within the project, a plugin
implementing AfterEveryFunctionCallAnalysisInterface will get called for
every function call, including calls of PHP builtins.

On the other hand, this interface doesn't allow modification of the code
nor tweaking the return type, but it's still useful for accounting
purposes and for depreacting calls to PHP builtins

this fixes #2804
2020-02-13 09:10:24 -05:00
Markus Staab
45468d801f Dont corrupt checkstyle xml 2020-02-09 15:54:37 -05:00
Matthew Brown
947765c1c6 Improve count checks slightly 2020-01-22 07:51:24 -05:00
Ben Davies
5139d61171 remove unnecessary loops (#2671) 2020-01-22 07:42:00 -05:00
Matthew Brown
8202af957d Index issues by file to reduce some lookups 2020-01-21 21:07:44 -05:00
Bruce Weirdan
ede1076039 Dropped unused use (#2495) 2019-12-21 00:58:05 +00:00
Bruce Weirdan
7e8268fe94 Drop non-existent param from docblock (#2492)
I wonder why psalm didn't catch it.
2019-12-21 00:14:22 +00:00
Matthew Brown
c9b5e96b0f Fix ref 2019-12-13 08:11:04 -05:00
Matthew Brown
d9cae720c1 Add slash 2019-12-03 08:33:31 -05:00
Matthew Brown
016fd58547 Add command in help 2019-12-03 02:18:44 -05:00
Matthew Brown
9f69d9ac99 Add CI_BRANCH var 2019-12-03 00:44:19 -05:00
Matthew Brown
a35d5f1308 Add temporary logging 2019-12-03 00:36:26 -05:00
Matthew Brown
843c08b8e1 Add emojis 2019-12-03 00:33:14 -05:00
Matthew Brown
946a46a761 Log when data is sent successfully 2019-12-03 00:13:46 -05:00