Matthew Brown
832a190dd4
Support enums ( #5699 )
...
* Add initial enum preparation
* Support cases method
* Ignore bad use error
cc @weirdan
* Fix type
2021-05-03 17:54:09 -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
ece138562f
Fix too-long line
2021-03-30 18:39:51 -04:00
Martin Gold
667568d925
Double directory separator on "Cannot resolve stubfile path" ( #5509 )
...
* fix: double directory separator on invalid stubfile path
* fix: non-existing stubfile error message
2021-03-30 11:55:33 -04:00
Matt Brown
d4377c0baf
Check upper bound too
2021-03-28 23:54:38 -04:00
Matt Brown
2d197e3e12
Allow older composer/semver cc @xurizaemon
2021-03-28 23:45:52 -04:00
Matt Brown
9f3f420a5b
Turn on unused variable detection by default on level 1
2021-03-22 09:44:40 -04:00
AndrolGenhald
45694d37d4
Fix composer major.minor version detection ( fixes #5415 ) ( #5416 )
...
* Fix composer major.minor version detection (fixes #5415 )
* Add PHP 8 polyfill dependency.
* Fix version check.
2021-03-18 09:42:01 -04:00
Matt Brown
c05a3ea073
Break up CoreGenericClasses
2021-03-06 16:05:14 -05:00
Vincent Langlet
a80d5b736b
Rename stub to avoid phpstorm conflict ( #5213 )
2021-02-13 18:42:34 -05:00
orklah
0e17a3354f
add stubs for standard iterators ( #4725 )
...
* add stubs for standard iterators
* Apply suggestions from code review cc @weirdan
Co-authored-by: Bruce Weirdan <weirdan@gmail.com>
* complete stub + delete code made redundant by stubs + fix some syntax in stubs
* fix parse error
Co-authored-by: Bruce Weirdan <weirdan@gmail.com>
2021-01-07 10:07:07 -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
09fb141e49
Document lowercase-string when possible ( #4904 )
...
* document lowercase-string
* fix missing strtolower
2020-12-29 11:42:12 +00:00
Matt Brown
387ab14bda
Use better stubs for Serializable and SoapClient
2020-12-08 11:27:51 -05:00
Matt Brown
1a629ccc82
Fix a few issues
2020-12-01 18:26:15 -05:00
Matt Brown
b717356f95
Simplify more things
2020-11-27 17:48:39 -05:00
Markus Staab
d393b4a69d
Added PDOStatement->fetchObject() stub ( #4693 )
...
* Added PDOStatement->fetchObject() stub
* fix stub param
* fix Xdebug spelling
* Use extension_loaded check instead
Co-authored-by: Matthew Brown <github@muglug.com>
2020-11-25 12:08:04 -05:00
Markus Staab
3dc311fd45
fixed exception message ( #4692 )
2020-11-24 16:04:34 -05:00
Matt Brown
2c77424e16
Fix #4656 - separate UnusedConstructor from UnusedMethod
2020-11-22 11:48:17 -05:00
Matt Brown
23ab0f1ddb
Allow Psalm to run in taint analysis mode without a config
2020-11-20 19:02:44 -05:00
Matt Brown
854a5b2ec5
Allow TaintedInput to suppress all emitted issues
2020-11-17 16:08:05 -05:00
Matt Brown
b731b53d5e
Add debug stuff for code complexity
2020-11-10 12:49:42 -05:00
Matt Brown
388e804ed8
Allow opt-in to strict return type checking
2020-11-05 18:20:04 -05:00
Matt Brown
cbd09adb2a
Only load xdebug stub afterwards
...
Ref #4459
2020-10-30 15:11:40 -04:00
Matt Brown
579327a470
Detect when targets are incorrectly targeted
2020-10-30 13:28:45 -04:00
Matt Brown
82f35c1454
Ensure Stringable is always available to tests that need it
2020-10-29 19:41:10 -04:00
Matt Brown
2e95d1fb98
Use more robust check for Stringable stub
2020-10-29 14:15:35 -04:00
Matt Brown
0344ff6858
Add polyfill for Stringable interface
2020-10-28 00:55:53 -04:00
Matt Brown
d58642a982
Maintain old behaviour when file does not exist
2020-10-25 16:38:58 -04:00
Matt Brown
2ea41b245c
Fix output in tests (for non-existent files)
2020-10-25 16:31:42 -04:00
Matt Brown
b26983cc34
Fix #4410 - use better path normalisation
2020-10-25 16:18:05 -04:00
feek
cc684eeccd
feature: ensure universal object crate class exists ( #4375 )
2020-10-20 17:17:49 -04:00
orklah
ceaaa39ec3
improve phpdoc ( #4352 )
2020-10-17 12:36:44 -04:00
Matt Brown
f3b05f5ab5
Move static code out of src
2020-10-12 00:59:19 -04:00
feek
8d2db4e673
feature: universal object crates ( #3948 )
...
* feature: universal object crates
* docs: document universal object crate config option
Co-authored-by: Matthew Brown <github@muglug.com>
2020-10-07 09:56:21 -04:00
Matt Brown
377dc8da8f
4.x - change/remove some default config values
2020-10-05 10:08:41 -04:00
Matt Brown
d5f4fd5b9c
4.x - don’t skip checks on unresolvable includes
2020-10-05 09:57:54 -04:00
Saif Eddin G
0475f379aa
add support for 'COMPOSER' env variable for alternate name of 'composer.json' ( #4275 )
2020-10-03 02:26:37 -04:00
orklah
1a1b88bb5e
add visibilities to constants ( #4219 )
2020-09-20 12:54:46 -04:00
orklah
a9a364e363
Misc improvements ( #4216 )
...
* misc changes
* fix CI
2020-09-20 08:55:28 -04:00
orklah
b19f0a7034
Remove empty() and use strict comparison when safe ( #4211 )
...
* replace empty usage with stricter checks
* use strict comparison when safe
* replace is_null with === null for consistency
2020-09-19 18:26:51 -04:00
orklah
5db75dfbf2
align default value with documentation ( #4188 )
2020-09-17 21:40:19 -04:00
Bruce Weirdan
cd110c7e2f
Added @psalm-stub-override
for classlikes and methods ( #4177 )
...
Fixes vimeo/psalm#1252
2020-09-13 16:40:31 -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
Brown
6ffe471525
Make new InvalidLiteralArgument issue for strpos refs
...
Ref #4070
2020-09-10 22:54:32 -04:00
Brown
fe4af8ff1a
Minor fixes
2020-09-07 17:22:43 -04:00
Brown
a83c0fe21a
Fix signature
2020-09-07 16:44:09 -04:00
Wouter Sioen
f3d3ef9074
Add consistent array type for predefined constants ( #4151 )
...
When running psalm through https://github.com/Roave/infection-static-analysis-plugin , you get a lot of warnings
```
Warning: array_key_exists() expects parameter 2 to be array, null given in /Users/woutersioen/Sites/madewithlove/htaccess/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/Sta
tements/Expression/Fetch/ConstFetchAnalyzer.php on line 124
```
This is because the config is instantiated without calling the collectPredefinedConstants method, thus making this a null value.
By adding a default value, we make it not required to call this method before running psalm.
2020-09-07 10:54:29 -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