1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-11 16:59:45 +01:00
Commit Graph

8479 Commits

Author SHA1 Message Date
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
Matt Brown
b33f87f68d Treat all assignment operations as equivalent binary ops 2021-06-04 14:39:38 -04:00
Matt Brown
be254efec6 Break out tests for readonly properties 2021-06-04 13:37:03 -04:00
Andrey Klimenko
e5e397a6c5
Type negation in generic context (#5879)
* Type negation in generic context

* Fix cs
2021-06-03 01:06:25 -04:00
Matthew Brown
1a2e761918 Remove incorrectly-committed code 2021-06-02 17:26:40 -04:00
Matthew Brown
577ae090c4 Bump LS memory to Psalm’s 2021-06-02 10:49:04 -04:00
Barney Laurance
e0eb8f88e5
Apply De Morgan's to output copy (#5872) 2021-06-02 06:32:50 -04:00
Matt Brown
f3fc112bae Fix #4523 - fix short-circuiting for properties and method calls 2021-06-01 16:06:12 -04:00
Fran Moreno
76225e54f6
Make toPHP second parameter optional (#5864) 2021-06-01 11:24:13 -04:00
kesselb
36d670b955
Add false as return value for mb_convert_encoding (#5862) 2021-05-31 22:24:34 -04:00
Bruce Weirdan
448534fd7c
Cli command classes (#5858)
* Move psalm entry-point to a Cli command class

* Moved psalter to the CLI command class

* Moved psalm-language-server to the CLI command class

* Moved psalm-refactor to the CLI command class

* Moved psalm_plugin to the CLI command class

* Use CLI commands directly and deprecate trampolines

* Require CLI commands directly and don't use trampolines

* Announce isAbsolutePath() removal

* Deprecate \Psalm\requireAutoloaders() function

* Deprecate \Psalm\getVendorDir() function

* Deprecate Psalm\getArguments() function

* Deprecate \Psalm\getPathsToCheck() function

* Deprecate \Psalm\getPsalmHelpText() function

* Deprecate \Psalm\initialiseConfig() function

* Deprecate Psalm\update_config_file() function

* Deprecate \Psalm\get_path_to_config() function

* Deprecate Psalm\getMemoryLimitInBytes() function

* CS fix

* Untangle Psalm entrypoint

* Untangle Psalter entrypoint

* Drop command_functions.php references

* Adjust phar build
2021-05-31 22:23:54 -04:00
orklah
0e8ca1d852
fix wrong version used in psalter (#5855) 2021-05-28 18:49:12 -04:00
Bruce Weirdan
997ffcda4c
Add $filter parameter to ReflectionClass::getConstants() (#5847)
Fixes vimeo/psalm#5837
2021-05-28 09:48:22 -04:00
Bruce Weirdan
e6607935a9
Encode control characters in literal strings (#5846)
Fixes vimeo/psalm#5733
2021-05-28 09:48:04 -04:00
Bruce Weirdan
c98b20247b
Flag unexpected tags on function docblocks (#5845)
* Flag unexpected tags on function docblocks

Fixes vimeo/psalm#5782

* Document new issue

* Fix spacing

Co-authored-by: Matthew Brown <github@muglug.com>
2021-05-28 09:47:39 -04:00
orklah
3bcfd2e726
allow psalter to add literal string/int in psalm phpdoc (#5844)
* allow psalter to add literal string/int in psalm phpdoc

* fix CS
2021-05-28 09:46:11 -04:00
Bruce Weirdan
0c77ccc238
Check whether constructor is internal on new call (#5843)
Fixes vimeo/psalm#5841
2021-05-28 09:44:07 -04:00
Ian Dunn
2a5afe3d03
Docs: Correct beeing typo (#5840) 2021-05-28 09:43:36 -04:00
orklah
276d355ebb
fix issue reporting when baseline already exists (#5838) 2021-05-28 09:43:15 -04:00
Oliver Hader
b259296457
[BUGFIX] Continue processing psalm-flow graph after first taint sink (#5832)
Related: #5830
2021-05-26 16:04:22 -04:00
Oliver Hader
4898cd262e
[TASK] Enrich taint details for outputting core stubs (#5827)
Affects `printf`, `print_r`, `var_dump`, `var_export`
2021-05-24 16:42:18 -04:00
Matt Brown
38c452ae58 Add example given in ticket and ensure that works too 2021-05-24 00:09:51 -04:00
Matt Brown
c258303f78 Fix test 2021-05-23 22:03:43 -04:00
Matt Brown
8f333337cb Fix #5804 - don’t choke on conditional return types when converting to callables 2021-05-23 21:41:07 -04:00
orklah
67413c88f9
fix #5797 (#5822) 2021-05-23 19:12:02 -04:00
orklah
aaab522a98
update baseline and fix issues (#5821) 2021-05-23 16:49:46 -04:00
orklah
de1bb954cf
Handle the case where a switch return on each case (#5819)
* Handle the case where a switch return on each case

* introduce a "hybrid" case exit type for cases where there's both "none" and something else
2021-05-23 16:24:29 -04:00
Matt Brown
7354ec9903 Fix #5298 - improve handling of method that may write properties 2021-05-23 16:22:52 -04:00
orklah
350df114f3
Transform bad offsets (#5817)
* Transform bad offset access

* fix build
2021-05-23 14:43:30 -04:00
Matt Brown
d1262b0bec Fix #5799 — improve expansion of templated types 2021-05-23 14:39:59 -04:00
orklah
89f815ff62
Add assertions for >=0 (#5815) 2021-05-23 14:24:15 -04:00
Matt Brown
938afc5aea Allow union of 0|positive-int to bypass PossiblyUndefinedIntArrayOffset error 2021-05-23 13:59:40 -04:00
Fran Moreno
e89f7e3960
Add mongodb Cursor and CursorInterface stubs and fix WriteConcern::__construct (#5813)
* Add mongodb Cursor and CursorInterface stubs

* Use proper variable name

* Update WriteConcern constructor

Based on https://www.php.net/manual/es/mongodb-driver-writeconcern.construct.php
2021-05-22 19:03:07 -04:00
orklah
c69cf9a849
Allow empty-string in first position of an type (#5814) 2021-05-22 12:36:02 -04:00
Matt Brown
6a61298074 Fix #5810 - detect properties that are never read 2021-05-21 09:25:57 -04:00
Matt Brown
4f9067f5c8 Fix unused properties in Psalm’s own codebase 2021-05-21 09:15:23 -04:00
orklah
4d6be66d98
Prioritize TCallableString handling to avoid simpler checks for TLowercaseString vs TString (#5811) 2021-05-21 07:44:26 -04:00
Matt Brown
4b17cc9a4b Fix #5809 - remove unnecessary issue suppression 2021-05-21 07:35:01 -04:00
yoshifp
110c9ef4e1
Fix typo in configuration.md (#5805) 2021-05-20 10:58:17 -04:00
Matt Brown
964c91c502 Fix skipped test 2021-05-20 10:57:25 -04:00
Matt Brown
3a811f1fb5 Fix/suppress failures 2021-05-19 15:30:36 -04:00
still-dreaming-1
ecb4ca8730
strlen can return positive-int (#5793) 2021-05-19 15:20:56 -04:00
Matt Brown
bbbde2ffa1 Fix empty line 2021-05-19 15:20:28 -04:00
Matt Brown
ccd50fdb34 Fix ##5795 - array casts should always be lists 2021-05-19 15:17:50 -04:00
orklah
f62b83a190
Assert intersection type when two variables are compared (#5774) 2021-05-18 16:14:58 -04:00
Matt Brown
3c43bc1522 Fix #5789 - prevent incorrect return type inference when all cases return 2021-05-18 08:52:41 -04:00
pawel-slowik
d82f02879c
Don't migrate virtual nodes (#5780)
* Add a failing test for issue #5002

* Don't try to migrate virtual nodes

Fixes #5002
2021-05-17 22:21:32 -04:00
Matt Brown
9eda9f9bbf Fix cs 2021-05-17 19:44:55 -04:00
still-dreaming-1
a62ee22adb
htmlspecialchars can return non-empty-string (#5785) 2021-05-17 19:43:08 -04:00
Matt Brown
21456f51e6 Only call ScopeAnalyzer once on whole function body 2021-05-17 18:52:25 -04:00