1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00
Commit Graph

8376 Commits

Author SHA1 Message Date
Matt Brown
0f5b117534 Migrate ClassLikeName options to object 2021-04-30 15:01:33 -04:00
AndrolGenhald
79fcf79219
Kill children on error and check if stream is closed before writing from child. (#5682)
* Kill children on error and check if stream is closed before writing from child.

* Use SIGTERM to kill children, reap children on error.
2021-04-30 09:01:24 -04:00
Vincent Langlet
fb5c5a9c59
Fix array<empty, empty> not in array{foo?: mixed}<string, mixed> (#5677)
* Fix array<empty, empty> not in array{foo?: mixed}<string, mixed>

* Add tests
2021-04-30 09:00:49 -04:00
Matt Brown
123a9bc703 Add type-accepts-type unit test 2021-04-27 11:26:27 -04:00
Matt Brown
698adeff07 Rename incorrectly-named test 2021-04-25 18:26:00 -04:00
Matt Brown
cd53e047a5 Improve messages 2021-04-25 17:26:25 -04:00
Matt Brown
4f5c205c57 Improve error message for #5489 2021-04-25 16:02:00 -04:00
Bruce Weirdan
933822e400 Do not consider isset checks on static properties as redundant (#5525)
* Do not consider isset checks on static properties as redundant

Unlike normal properties, static properties do not have a prescribed
initialization sequence, so they can always be uninitialized (or unset).
Thus `isset()` checks on them are never redundant.

Fixes vimeo/psalm#5489

* Fix issue with nullable is_static
2021-04-25 15:53:07 -04:00
Matthew Brown
85a0ef0456
Revert "Do not consider isset checks on static properties as redundant (#5525)" (#5670)
This reverts commit cd002e6a87.
2021-04-25 15:46:13 -04:00
Matt Brown
83f08bc1b8 Fix property tests 2021-04-25 15:22:32 -04:00
Matt Brown
67c5dc3c79 Fix #5517 - don’t let a variable’s by-refness be overwritten by a @var docblock 2021-04-25 15:11:23 -04:00
Matt Brown
7b7354efa3 Fix #5518 - add type for property with variable name 2021-04-25 14:49:43 -04:00
Matt Brown
daa40281df Add slashes 2021-04-25 13:32:58 -04:00
Matt Brown
2fa55d147a Allow parent class to call child protected method 2021-04-25 12:44:53 -04:00
Matt Brown
64fdac33e8 Fix #5641 - types should always be comparable to themselves 2021-04-25 10:45:43 -04:00
Matt Brown
419114e1f0 Fix #5662 — prevent crash when reporting mixed issue on virtual arg 2021-04-23 15:34:35 -04:00
Matt Brown
ecd5e3b7ae Fix #5652 - use accurate type combination rules when replacing templated union 2021-04-22 00:33:49 -04:00
Benjamin Morel
3d908eda7e
Fix psalm-assert-is-false example (#5659) 2021-04-21 21:32:57 -04:00
orklah
0d524ecd5b
adding documentation about @no-named-arguments and allowNamedArgumentCalls (#5654) 2021-04-21 01:02:25 -04:00
Vincent Langlet
39e61ae942
Add support for phpstan import-type and type annotations (#5648)
* Add support for phpstan import-type and type annotations

* Add test

* Fix cs
2021-04-19 22:56:08 -04:00
Mark McEver
d773007f29
Added a missing word to the docs (#5644) 2021-04-19 11:46:22 -04:00
Matt Brown
40b6860881 Workaround Phar compaction error 2021-04-18 23:28:34 -04:00
Matt Brown
6e9003a28b Add collections checks again 2021-04-18 19:22:03 -04:00
Matt Brown
642f2f435c Fix #5640 - improve handling of assignments in conditional 2021-04-18 16:16:54 -04:00
Matt Brown
bb0bfda7c5 Improve mic drop variable name 2021-04-18 15:50:50 -04:00
Matt Brown
0acc02e184 Use more descriptive names for properties & variables of if/else handling 2021-04-18 15:38:12 -04:00
Alessandro Lai
ee778e9246
Allow Xdebug handler 2.0 (#5633) 2021-04-16 16:07:47 -04:00
Alexander Makarov
ff00255c19
Fix excluding binary path under Windows (#5628)
* Fix excluding binary path under Windows

* Fix CS
2021-04-15 06:55:45 -04:00
Bruce Weirdan
93946d0827
Forbid rejecting named arguments when parent allows them (#5627)
Fixes vimeo/psalm#5622
2021-04-15 06:55:13 -04:00
Matthew Brown
93e9054f98
Remove collections 2021-04-13 00:02:01 -04:00
Matthew Brown
e505cd58b4
Add use 2021-04-12 23:52:50 -04:00
Jacob Dreesen
5777c00073
Add missing opening PHP tag in the docs (#5617)
* Add missing opening PHP tag in the docs

* Fix typo
2021-04-12 23:50:52 -04:00
Matt Brown
f874740c83 Fix phpcs 2021-04-10 22:01:07 -04:00
Matt Brown
b7f122425f Use proper variable 2021-04-10 21:48:50 -04:00
Abdul Malik Ikhsan
2a31b66978
Add json_last_error to impure function (#5613)
* Add json_last_error to impure function

* add 'json_encode', 'json_decode' as well

* revert json_encode and json_decode
2021-04-10 20:38:02 -04:00
Matt Brown
012dafad79 Fix #5383 - prevent unsound use of new static for generics 2021-04-10 13:16:19 -04:00
orklah
bb88cff28a
Int and Float can be reconciled with Numeric (#5611) 2021-04-09 23:59:59 -04:00
3b3065c881
Allow variable keys with array_key_exists (#5606)
* Allow variable keys with array_key_exists

* Switch to elseif
2021-04-09 11:29:45 -04:00
AndrolGenhald
9f0d13998f
Fix race condition creating parser cache directory (fixes #4483) (#5603)
I wasn't able to reproduce the error under normal conditions, but I set a
breakpoint on the `mkdir` call, created the directory, then continued, and it
seems to handle it correctly.
2021-04-09 11:29:09 -04:00
AndrolGenhald
518d0af895
Strict int/float comparison for conditional types, improve range return type (#5601) 2021-04-09 11:28:48 -04:00
orklah
5f4a21190f
Numeric can be Falsy (#5598) 2021-04-07 22:02:13 -04:00
AndrolGenhald
870c433dc2
Check oldest ancestor for protected method visibility (fixes #5595) (#5597) 2021-04-07 22:01:41 -04:00
AndrolGenhald
9a03598a6d
Improve type resolution of class constants. (#5591)
Handle array plus operator (fixes #5588).
Handle array spread operator.
Improve string concatenation to resolve to literal instead of unknown string.

I feel like it should be possible to let ConstantTypeResolver take advantage of
the better type analysis in ArrayAnalyzer, ConcatAnalyzer, etc, but it would
require a restructuring that's beyond me for the time being.
2021-04-07 21:56:35 -04:00
Matt Brown
a469c82653 Fix #5587 - detect final class calls when routed through parent 2021-04-06 12:35:09 -04:00
ccf4c91688
The return value of generator methods can potentially be null (#5577)
* The return value of generator methods can potentially be null

* Add @psalm-ignore-nullable-return
2021-04-06 11:28:39 -04:00
Matt Brown
7080bc3bff Fix #5578 - variables always set in conditionals should be combined 2021-04-06 11:11:40 -04:00
Valentin Udaltsov
6851b5c1f1
Added TValue template to PDOStatement stub (#5579) 2021-04-05 18:20:59 -04:00
Matt Brown
517b2030c9 Fix #5545 - throwing uses method 2021-04-04 21:17:12 -04:00
Bruce Weirdan
f07b6e675e
Support array of objects in array_column() (#5567)
Fixes vimeo/psalm#5460
2021-04-04 00:01:01 -04:00
Bruce Weirdan
34cb21c7fc
Report cases where object is coerced into object with properties (#5566)
Fixes vimeo/psalm#5565
2021-04-04 00:00:31 -04:00