1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-13 17:57:37 +01:00
Commit Graph

304 Commits

Author SHA1 Message Date
Matthew Brown
6085e42fc1 Detect mismatching param names effectively 2020-08-10 09:58:43 -04:00
Brown
488a899823 Fix Psalm issues 2020-08-05 19:49:09 -04:00
Nat Zimmermann
a1a403e046
make meta path optional (#3833) 2020-07-17 10:09:42 -04:00
kesselb
aaba3a08ec
Add option to supress a referenced but undefined global variable. (#3827) 2020-07-16 09:49:59 -04:00
Bruce Weirdan
931d35a703
Collect and scan files included by the autoloaders (#3183)
Refs vimeo/psalm#2861
2020-07-11 17:17:22 -04:00
Jon Ursenbach
6aca4c169e
feat: adding a runTaintAnalysis option into the config (#3800) 2020-07-10 13:22:03 -04:00
Joe Hoyle
0119cd09c1
Always deep scan stubs (#3781)
In many sitations, stub files will receive a shallow _and_ deep scan when project files require extra analysys on things like parent classes. This makes stub file scanning inconsistent (orders become much less predictable for example), and adds extra process time to scan the files twice. In the case of stubs providing classes and functions for large projects, this is a non-trivial amount of time.

As deep scanning stubs should take just about as long as a shallow scan, it makes sense to just always deep scan them.

Fixes #3568.
2020-07-08 17:42:51 -04:00
Tyson Andre
bee10a2eb4
Add a --debug-emitted-issues flag (#3637)
And support --debug-by-line in psalter and psalm-refactor.
Those were previously not supported in getopt()

Fixes #3634
2020-06-22 18:16:47 -04:00
Brown
fbe3433edd Use escape terminology 2020-06-21 11:43:08 -04:00
Brown
078b8b7b1a Fix #3618 - add way to load non-analyzed files 2020-06-19 00:13:09 -04:00
Olle Härstedt
e1cc27f7a2
Add new config: sealAllMethods (#3578)
* Add new config: sealAllMethods

* Add some more tests

* Fix codesniffer issue with preg_quote

* Fix missing method in test

Co-authored-by: Olle <noemail>
2020-06-15 22:36:42 -04:00
orklah
76f5def268
Use scandir and glob flags to reduce their performance impact (#3499)
* Use scandir and glob flags to reduce their performance impact

* Order seem to impact Tests here
2020-05-30 17:02:35 -04:00
Brown
a266d4748b Fix build 2020-05-26 07:50:11 -04:00
Brown
953be61cf2 Allow limiting connected taint paths 2020-05-25 23:28:11 -04:00
Matthew Brown
f3a6e1a48c Fix ref 2020-05-10 16:01:45 -04:00
Matthew Brown
733da0e539 Fix #3311 - don’t erroneously mark a class as undefined
As they can sometimes only be obvious once an autoloader has been registered
2020-05-10 15:55:44 -04:00
orklah
8571746f8a
Add hook for plugins after FunctionLikeAnalysis (#3258) 2020-04-28 15:30:51 -04:00
Brown
4b36c4e4bf Add stub for json_encode 2020-04-04 11:18:24 -04:00
Brown
f6759c3d16 Check return statement types for inherited docblocks 2020-03-24 17:59:48 -04:00
Brown
d1fcbf38ae Fix #2956 - treat Exception::getMessage as final and mutation-free 2020-03-10 15:12:55 -04:00
Matthew Brown
6129d533d8 Fix #2879 - rename stubs to prevent issues in PHPStorm 2020-03-01 17:28:51 -05:00
Philip Hofstetter
d315822bfa make skipping of checks after invalid includes configurable
as suggested in the PR it's best to make the setting configurable.

In order not to break existing installations, we default to keeping the
old behaviour, but in a later version of psalm, we might change the
default.
2020-02-27 18:49:23 -05:00
kolja
f189b25b99 Fixed stub files with absolute paths not being loaded. 2020-02-26 17:13:40 -05:00
Matthew Brown
2e4154d76e Add better defaults and documentation 2020-02-18 20:30:37 -05:00
Matthew Brown
c9494c43a3 Hide mixed issues if totallyTyped="false" 2020-02-18 20:08:09 -05:00
Matthew Brown
23b9331f6d Hide mixed errors if your error level is >= 3 2020-02-18 19:57:38 -05:00
Brown
520b646ef6 Add suppressMixedIssues config flag to hide mixed issues 2020-02-18 17:23:48 -05:00
Brown
6e8088776d Use better return type for SimpleXMLElement::offsetGet 2020-02-18 10:58:56 -05:00
Brown
38cccb8aaf Fix #2831 - use correct name for mapping 2020-02-18 10:39:24 -05:00
Matthew Brown
201d54f232
Convert to string before comparison 2020-02-18 09:40:21 -05:00
Matthew Brown
320f3ec863 Update level config name 2020-02-17 22:43:13 -05:00
Matthew Brown
aab8eed219 Fix Phar-scoped issue checks 2020-02-17 22:07:08 -05:00
Matthew Brown
0c2b10709e If no level or totallyTyped is given, use level 2 2020-02-17 22:06:55 -05:00
Matthew Brown
f49c896f94 Allow totallyTyped to control level 2020-02-17 22:06:46 -05:00
Matthew Brown
ced092874a Make config generation smarter 2020-02-17 22:05:58 -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
Matthew Brown
8d7fb2b415 Add config flag to support properties without a magic getter 2020-02-02 14:23:38 -05:00
Philip Hofstetter
f6983fd883 allow setting php version from config or composer.json
if a composer.json is present and a PHP version requirement is
configured, we set the php version to the minimal PHP version that
satisfies the composer requirement.

Additionally, this adds a `phpVersion` attribute to the <psalm> tag. If
that's set, it takes precedence over what has been detected in
composer.json.

And finally, the --php-version command line flag continues to work and
takes precedence over the setting in the <psalm> tag

this fixes #2628
2020-01-30 08:48:53 -05:00
SignpostMarv
dc80880a80 check if phpstorm meta path is a file or directory (#2643)
* check if phpstorm meta path is a file or directory, making a note if it was a directory, re: #2640

* import is_file()

* overcautiously glob into meta directory
2020-01-22 11:06:06 -05:00
Bruce Weirdan
17857163fc Modular config files (#2635)
This change introduces an option to have the configuration split across
several files using standard XInclude tags. This may be useful for more
complex configs, or to include auto-generated parts into a manually
written config file.
2020-01-16 15:57:52 -05:00
Brown
bd2cbf28e3 Add parent issue type for UndefinedMagicMethod 2020-01-06 14:24:20 -05:00
Matthew Brown
867511d7fd Use more specific error magic properties 2020-01-05 21:07:26 -05:00
Matthew Brown
a154191922 Fix #2380 - prevent string docblock for callable param 2019-11-27 09:18:47 -05:00
Brown
af5f83602e Break out more specific possibly defined offset errors 2019-11-11 09:59:56 -05:00
Brown
89752b8574 Support ext-ds and fix offset count 2019-10-18 11:35:24 -04:00
Brown
b0aaede9e1 Add support for checking integer array offsets 2019-10-04 11:08:08 -04:00
Matthew Brown
9ad6c36d9b
Conditionally verify that array offsets exist (#2147)
* Check array offsets idea

* Clean up some issues

* Add a few light fixes

* Add docs
2019-09-18 14:21:06 -04:00
SignpostMarv
943705ce0e load an xdebug stub when required, re: vimeo/psalm#2118 (#2133)
* load an xdebug stub when required, re: vimeo/psalm#2118

* correcting case sensitivity of XDebug to Xdebug

* only load the Xdebug stub when needed
2019-09-14 10:13:39 -04:00
Matthew Brown
51e552665e Fix #2061 - add config to allow suppression of string increment issues 2019-09-01 17:49:37 -04:00
Matthew Brown
6ad5d31132 Fix how hideExternalErrors behaves to match expectation
Fixes #2074
2019-09-01 10:56:55 -04:00