Bruce Weirdan
ec7de89f0c
Do not let string subtypes subsume class-strings ( #5497 )
...
Previously, Psalm would treat unions like `class-string|numeric-string`
as `numeric-string`, while the only case when string should subsume
`class-string` is when we're combining `class-string` with non-specific
`string`.
Fixes vimeo/psalm#5491
2021-03-28 23:12:23 -04:00
Matt Brown
9a714b759e
Fix #5496 - ensure params extended in properties are properly fleshed out
2021-03-28 23:10:38 -04:00
Matt Brown
f41deeab0a
Taint through reset call
2021-03-28 13:14:35 -04:00
Matt Brown
f24ef253e3
Add better trace for MixedOperand issues
2021-03-28 12:09:16 -04:00
Matt Brown
93743d1465
Also add better message for MixedArgumentTypeCoercion
2021-03-28 11:32:38 -04:00
Matt Brown
54ac13b190
Allow nested template unwrapping inside reset
, end
...
Fixes #5208
2021-03-28 09:52:23 -04:00
Matt Brown
2f5bec33be
Fix reference
2021-03-27 22:46:23 -04:00
Matt Brown
d4a3e363e0
Add Psalm level badge
2021-03-27 22:45:39 -04:00
Matt Brown
72226c500a
Add level to shepherd data
2021-03-27 22:24:38 -04:00
Yuta Nagamiya
d435d4d011
Add the Psalm badge ( #5492 )
2021-03-27 11:07:08 -04:00
Matt Brown
c64e879178
Only check param-out when no exception is thrown
2021-03-27 09:50:20 -04:00
orklah
12cd9590c8
allow $var::class on templates ( #5484 )
2021-03-26 21:21:38 -04:00
sji
19554de6f6
Add @ignore-var
and @psalm-ignore-var
( #5488 )
...
* add `@ignore-var` and `@psalm-ignore-var`
* Change two words
Co-authored-by: Matthew Brown <github@muglug.com>
2021-03-26 21:20:23 -04:00
Saif Eddin Gmati
9f74676524
allow dismissing return value of pure functions with by-reference arguments ( #5463 )
2021-03-25 09:05:59 -04:00
Sergei Morozov
b627962e63
Fix oci8 stubs for PHP 8 ( #5478 )
2021-03-25 00:49:53 -04:00
Bruce Weirdan
a025311e39
Restrict errorLevel and type attributes to valid values ( #5476 )
...
This provides better validation and autocompletion for psalm.xml
2021-03-25 00:27:54 -04:00
Matt Brown
929f931c14
Taint mixed keys too
2021-03-24 16:42:30 -04:00
Jean-Nicolas
30f64b79de
Checks the intersection type if the magic method does not exist ( #5473 )
2021-03-24 15:34:05 -04:00
Matt Brown
10ccbdd8be
Add tainting for array keys
...
Fixes #5470
2021-03-24 15:32:56 -04:00
Matt Brown
937e68cc75
Change taint path names to prepare for allowing array key tainting
2021-03-24 15:23:56 -04:00
Matt Brown
9ad88256d1
Fix error message
2021-03-24 14:32:01 -04:00
Matt Brown
5ecab7b9e7
Bump minimum version of composer/semver to allow constraint parsing
2021-03-24 12:30:13 -04:00
2edf61399a
Add detailed POSIX functions type annotations ( #5469 )
2021-03-24 09:52:34 -04:00
b61ff8cffb
Allow string template params in concatenation ( #5468 )
2021-03-24 09:52:10 -04:00
Sergei Morozov
355c4f7f09
Fix mysqli_real_connect() signature ( #5464 )
2021-03-24 09:51:33 -04:00
Matt Brown
efa9b136d3
Fix linting issues
2021-03-23 19:42:56 -04:00
Saif Eddin Gmati
477ae33cd6
allow dismissing return value of no-return pure functions ( #5461 )
2021-03-23 19:34:12 -04:00
Matt Brown
a96645d2e3
Fix many uses of offsets
2021-03-23 01:30:51 -04:00
Matt Brown
15b0542260
Prevent more offset issues
2021-03-22 23:26:03 -04:00
Matt Brown
bf578d1024
Fix potential crash when calling magic setter
2021-03-22 23:08:38 -04:00
AndrolGenhald
de5a031088
Improve @no-named-arguments support and variadics. ( #5455 )
...
* Improve @no-named-arguments support and variadics.
Handling of argument unpacking and variadics still needs a pretty big makeover, but this is a good start.
Fixes #5420
Improves #5453 (iterable works, array still causes issues)
* Remove unneeded imports.
2021-03-22 19:58:22 -04:00
Matt Brown
07897456e3
Back to 7.4
2021-03-22 19:53:42 -04:00
Matt Brown
b02b684a06
Run on real projects on latest PHP
2021-03-22 19:48:31 -04:00
Matt Brown
ae1fd44b13
Resolve build issues
2021-03-22 19:37:49 -04:00
Matt Brown
9f3f420a5b
Turn on unused variable detection by default on level 1
2021-03-22 09:44:40 -04:00
Sergey Yakimov
fb94db9b1f
Add proper handling of unpacked arguments with string keys ( #5446 )
...
* Add proper handling of unpacked arguments with string keys
* Fix undefined array key error
* Fix missed named arguments handling
* Fix false-positive on variadic parameter
* Add tests
2021-03-22 09:08:05 -04:00
Bruce Weirdan
4eca6acebd
Don't crash on index types used in a conditional type ( #5447 )
...
Fixes crash reported in vimeo/psalm#5423
2021-03-22 09:07:14 -04:00
Matt Brown
b73223f9c1
Add use statements
2021-03-20 22:17:22 -04:00
Matt Brown
f69cab8c02
Fix extra issue tests
2021-03-20 21:55:17 -04:00
Matt Brown
44c6d3035b
Add more mixed origin information
2021-03-20 21:45:38 -04:00
Matt Brown
7f8d522912
Make all mixed issues implement MixedIssue
2021-03-20 21:44:04 -04:00
Matt Brown
d1740394aa
Detect mixed echo argument when unused variable detection is turned on
2021-03-20 20:53:51 -04:00
Bruce Weirdan
b4fab67f3b
Fix DateTimeZone::listIdentifiers() and timezone_identifiers_list() signature ( #5443 )
...
Including historic changes, according to php.net docs.
Fixes vimeo/psalm#5442
2021-03-20 15:43:05 -04:00
Samuel Mortenson
e07337650b
Make taint source keys unique to the added taints. ( #5444 )
2021-03-20 15:42:24 -04:00
Bruce Weirdan
8d78372d43
Use appveyor reporter instead of a file upload ( #5438 )
...
* Use appveyor reporter instead of file upload
* Use tagged version of appveyor reporter
2021-03-19 23:25:34 -04:00
AndrolGenhald
0579c1109b
Fix bugs with array spread operator ( fixes #5421 ) ( #5433 )
2021-03-19 22:43:58 -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
AndrolGenhald
843305c8e0
Support template property invariance ( fixes #5371 ) ( #5414 )
...
* Support property invariance with templates.
* Fix false positive NonInvariantDocblockPropertyType with grandchild.
* Redo templated property invariance check to fix issues.
* Add template covariant test.
* Fix property invariance false positive with template-covariant.
2021-03-19 21:55:50 -04:00
AndrolGenhald
17f23ccb30
Fix false-positive with non-empty object like array ( fixes #5436 ) ( #5437 )
2021-03-19 21:54:01 -04:00
AndrolGenhald
b859fba52d
Fix array spread false negative that crashes ( fixes #5431 , reverts #2852 ) ( #5432 )
2021-03-19 21:51:36 -04:00