Matthew Brown
4873f53f69
Fix issue when two continue/break statements write same variable
2021-05-13 09:39:25 -04:00
Matthew Brown
f6e4fb1263
Analyse real projects with PHP 8.0
2021-05-13 09:34:32 -04:00
orklah
1a59e81808
allow scalar values in return to be accepted, even when the branch has no inferred types ( #5749 )
2021-05-12 18:47:05 -04:00
orklah
ab1732de66
combining never/empty twice gives never ( #5756 )
2021-05-12 18:46:37 -04:00
40bc7cf294
callable-string is always a non-empty-string ( #5741 )
2021-05-10 11:47:32 -04:00
orklah
72022139fa
improve array_splice inference ( #5738 )
2021-05-10 11:45:52 -04:00
Matthew Brown
859b4a2caa
Fix #5725 – don’t transform non-docblock types unnecessarily
2021-05-09 12:03:42 -04:00
Vincent Langlet
587b144f0e
Check for ParamName even for method with only one param ( #5732 )
...
* Check for ParamName even for method with only one param
* Fix tests
2021-05-08 19:33:48 -04:00
Robert Chettleburgh
fe190c2eb7
unpack() can return false on error ( #5726 )
...
* Unpack() can return false on error
* unpack only returns false rarely
supporess with @psalm-ignore-falsable-return
Co-authored-by: Bruce Weirdan <weirdan@gmail.com>
Co-authored-by: Bruce Weirdan <weirdan@gmail.com>
2021-05-06 14:32:17 -04:00
Bruce Weirdan
4b8bff45bd
Forbid unused uses in Codebase\Scanner ( #5717 )
2021-05-06 14:31:28 -04:00
Bruce Weirdan
aa854ae338
Link to SARIF JSON schema ( #5718 )
...
Fixes vimeo/psalm#5716
2021-05-05 21:47:36 -04:00
Bruce Weirdan
f5a58adcac
Prefer @psalm-template
over @phpstan-template
( #5713 )
...
* Prefer `@psalm-template` over `@phpstan-template`
Fixes vimeo/psalm#5590
* Prefer `@psalm` templates for methods as well
2021-05-05 21:47:01 -04:00
Bruce Weirdan
58c8e75db3
Suppress issues emitted by MethodComparator at class level ( #5711 )
...
Fixes vimeo/psalm#5698
2021-05-05 21:46:29 -04:00
Bruce Weirdan
9e19653a72
Infer never
return type ( #5710 )
...
* Allow __toString to return never
Fixes vimeo/psalm#5653
* Push $return_is_exit down
* Produce unique control actions
* Test suggesting `@return never`
2021-05-05 01:22:29 -04:00
Matt Brown
ed43c739e3
Prevent another unsafe template situation, skipping key-of tests for now
2021-05-05 01:06:53 -04:00
Matt Brown
f95458be61
Setting values on templated arrays should corrupt them
2021-05-05 00:46:43 -04:00
Matt Brown
ba90267ea7
Fix bad subtyping rule
2021-05-05 00:42:06 -04:00
Bruce Weirdan
27ea40eda0
Fix notice for certain invalid docblocks ( #5709 )
...
Fixes vimeo/psalm#5680
2021-05-03 22:28:17 -04:00
Bruce Weirdan
0189420814
Inherit class-level suppressions when checking methods ( #5708 )
...
Fixes vimeo/psalm#5687
May fix vimeo/psalm#3357
2021-05-03 22:26:56 -04:00
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
d93c30d997
Fix Never test for latest PHP Parser
2021-05-03 16:59:24 -04:00
Matt Brown
0c30a94b4a
Remove unused variable
2021-05-03 15:13:24 -04:00
Matt Brown
881dbf86e1
Fix inference for empty arrays
2021-05-03 12:40:14 -04:00
Matt Brown
eb71506a59
Fix #5697 - don’t consider docblocks when checking for invariant properties
2021-05-02 10:45:55 -04:00
Matt Brown
12844621b4
Fix #5693 - revert fix for #2048
...
The original fix was just a bit too narrow, and led to this bug
2021-05-01 21:13:42 -04:00
Matt Brown
0f7aaa5405
Fix #5696 - combinations of scalars should remove empty-scalar
2021-05-01 20:13:49 -04:00
Matt Brown
3a87f18b5a
Fix #5685 - properly negate complex conditionals
2021-05-01 20:00:01 -04:00
Matt Brown
83a0325c0a
Always run legacy plugins first
...
Legacy plugins are more likely to be custom-made, non-legacy ones like the PHPStorm meta scanner contain more generic info
2021-05-01 16:56:25 -04:00
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