1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 09:37:59 +01:00
Commit Graph

5868 Commits

Author SHA1 Message Date
18a6c0b6e9 Implement by-ref closure use analysis 2023-12-03 15:28:51 +01:00
orklah
0659967d05
Merge pull request #10429 from tscni/fix/trait-call-static
Fix static magic method pureness not being inherited from traits
2023-12-02 14:30:49 +01:00
Tinjo Schöni
4f458b46bc
Fix static magic method pureness not being inherited from traits
https://github.com/vimeo/psalm/pull/10385 "broke" this by propagating pseudo static methods from traits to using classes.
`AtomicStaticCallAnalyzer` was then not capable of dealing with this, because now these static pseudo methods actually exist.

As long as the methods from traits aren't actually transferred to the using class, it seems right that the logic in `AtomicStaticCallAnalyzer` uses `::getDeclaringMethodId()` instead of `::getAppearingMethodId()` for this purpose.
2023-11-29 23:22:14 +01:00
Tinjo Schöni
d91aab15be
Restore support for null coalesce on match expressions
https://github.com/vimeo/psalm/pull/10068 added isset restrictions that didn't consider null coalesces on match expressions.
This restores that support by converting the match expression to a virtual variable for the isset analysis, similar to other incompatible expressions.
2023-11-29 02:08:23 +01:00
73a340fde8 Cleanup 2023-11-26 19:46:45 +01:00
35f194e9e8 Fix backtick analysis 2023-11-26 13:12:11 +01:00
orklah
579cc084cc
Merge pull request #10370 from kkmuffme/fix-misc-callable-bugs
Fix misc callable bugs
2023-11-22 21:19:56 +01:00
kkmuffme
0d7c5a2d8e Fix docblock mixed escape hatch
revert https://github.com/vimeo/psalm/pull/7663 including previous from_docblock Mixed assignments, as the tests required 2 suppressions and created an escape hatch via mixed on higher psalm error levels, where mixed isn't reported, thus hiding potentially fatal bugs.
It's still possible to run the validation of docblock docs though: a @var declaration that contains both possible types, to ensure later code won't escape any checks (and no @psalm-suppress needed at all)

This is also a required preparation to fix some isset issues of https://github.com/vimeo/psalm/issues/9759
2023-11-21 13:01:55 +01:00
kkmuffme
d94f7bd553 loose comparisons of int with string shouldn't change change the int to empty-mixed 2023-11-21 13:01:15 +01:00
kkmuffme
fd2f876574 Remove tests for partially stubbed classes introduced in https://github.com/vimeo/psalm/issues/849, as this didn't work correctly and lead to errors not being reported at all in many cases (since the error was reported for the stubs file and therefore suppressed)
With the previous commit "Fix for classes what https://github.com/vimeo/psalm/pull/8503 fixed for functions", the stubs of classes where the actual file is in the analyzed files are ignored completely.
2023-11-18 08:55:20 +01:00
kkmuffme
3299689d99 revert 804087b of https://github.com/vimeo/psalm/issues/10026 2023-11-18 08:55:20 +01:00
kkmuffme
be6028d7d4 Fix potential cache race conditions/cache not deleted with non-lowercase file paths and add missing docs 2023-11-18 08:55:20 +01:00
kkmuffme
adb8677f20 Fix optional args not enforced in callable (fix for non-closure/arrow functions of https://github.com/vimeo/psalm/issues/8438) Fix array callables not treated as callable https://psalm.dev/r/23f3787207 (this is needed to fix the optional args enforcement for array callables too) 2023-11-18 08:55:20 +01:00
kkmuffme
0ca2d4f597 Fix https://github.com/vimeo/psalm/issues/6085 2023-11-18 08:55:20 +01:00
kkmuffme
5eacd301e9 Fixed ReturnTypeWillChange false positive https://psalm.dev/r/91c6992bf1 with missing return type signature 2023-11-18 08:55:20 +01:00
kkmuffme
0252bbbd7c Fixed https://psalm.dev/r/7f112fd745 - MethodComparator only reported an error for this if the parent class was user defined (= not in stubs), which is wrong, since this will cause a fatal error when running the code 2023-11-18 08:55:20 +01:00
kkmuffme
c5655c510d Fix param providers for native methods not working Fix array_filter params callable incorrect required params depending on the 3rd argument value (at this commit psalm doesn't report an error, due to https://github.com/vimeo/psalm/issues/8438, which gets fixed by this PR later on though) Fix https://github.com/vimeo/psalm/issues/3047 and further improve types for array_multisort and add errors for invalid params Fix SimpleTypeInferer failing on bitwise operations with constants 2023-11-18 08:55:20 +01:00
kkmuffme
ba79797627 Fix https://github.com/vimeo/psalm/issues/10371 2023-11-18 08:55:20 +01:00
kkmuffme
506fb9c773 Fix https://github.com/vimeo/psalm/issues/8919 2023-11-18 08:55:20 +01:00
kkmuffme
be85cb02b9 remove now invalid test 2023-11-18 08:55:20 +01:00
kkmuffme
f3e9263ea4 Fix array_filter callback type
Fix https://github.com/vimeo/psalm/issues/9068
2023-11-18 08:55:19 +01:00
Ivan Sidorov
e677523843 Fixing a collisions on annotations with mixins 2023-11-17 15:50:34 +00:00
Ivan Sidorov
8bb68e9b3f Find properties and methods annotated by mixin 2023-11-17 15:50:34 +00:00
Ivan Sidorov
0c4b8a3c49 Find annotated magic static methods on traits 2023-11-17 15:50:34 +00:00
Ivan Sidorov
ceba3d889d Find annotated magic static methods on parent class 2023-11-17 15:50:34 +00:00
Ivan Sidorov
75394c5037 Find declared methods on parent classes and traits
Partial revert commit 2f039f9072
2023-11-17 15:50:26 +00:00
Ivan Sidorov
d533bb8c2e Ignore annotated magic static methods with usage object gap
Magic methods annotated by methods `__call` and `__callStatic`.
Magic static methods implemented in `__callStatic`
are not required implementation in `__call'.
2023-11-17 15:14:56 +00:00
Ivan Sidorov
715f6f51e1 Ignore annotated magic properties with usage static gap
In PHP is not exists methods for implementation magic static properties.
So, these magic static properties must not be presented.
2023-11-17 15:14:56 +00:00
Ivan Sidorov
1cfc343c43 Ignore declared static properties with usage object gap
Usage static properties in PHP is allow only by static gap.
2023-11-17 15:14:56 +00:00
Ivan Sidorov
6f19440b02 Fix text-labels with type of property
The labels for magic and declared properties must be equal.
2023-11-17 15:14:56 +00:00
Ivan Sidorov
650b8fcd1b Tests of current behaviors in the auto-completion feature 2023-11-17 15:14:56 +00:00
kkmuffme
b0adeb463d fix test 2023-11-13 20:37:48 +01:00
kkmuffme
88e3cda3b9 remove unused function, fix unusedVariable error after suppress 2023-11-13 20:24:58 +01:00
kkmuffme
6a0a9d1c15 fix failing test caused by psalm-suppress as this should be invalidCodeParse test 2023-11-13 19:08:04 +01:00
kkmuffme
dcd53cadab Suppressing NoValue should not treat subsequent code as unevaluated
Fix https://github.com/vimeo/psalm/issues/10302
2023-11-13 18:57:41 +01:00
Ivan Sidorov
2f039f9072 Fix auto-completion with declared static method by DocBlock 2023-10-27 09:35:30 +00:00
Ivan Sidorov
d6faff2844 Fix auto comletion by partial property or method 2023-10-26 21:31:47 +00:00
Daniel Linjama
a375f441f2 fix @param-out with named arguments 2023-10-23 10:39:09 +03:00
3b66272aa0 More rector fixes 2023-10-21 20:45:09 +02:00
576e4d2bc4 Fix method calls and property accesses after extension_loaded 2023-10-19 11:16:20 +02:00
orklah
5a862784ac
Merge pull request #10289 from ging-dev/add-fix
Additional caching fixes
2023-10-17 20:32:03 +02:00
robchett
e2d1e83b87 Fix memory explosion with calls to method_exists 2023-10-17 19:15:23 +01:00
ging-dev
8ee875086f chore: add failing test 2023-10-17 20:17:15 +07:00
ging-dev
0162e75ee8 fix: #10080 2023-10-17 02:43:22 +07:00
orklah
b432d812fb
Merge pull request #10274 from tuqqu/enum-case-value-type-from-class-constant
Fix inferring enum case value from a class constant
2023-10-16 20:25:11 +02:00
orklah
7a7d6a25af
Merge pull request #10242 from cgocast/5.x
Allow tainted numerics except for 'html' and 'has_quotes'
2023-10-16 20:17:39 +02:00
tuqqu
6039e2be9b Fix for inferring enum case value from a class constant 2023-10-10 22:56:36 +02:00
orklah
ee4e8aa720
Merge pull request #10271 from klimick/type-check-nested-templates
Type check nested templates
2023-10-09 19:47:15 +02:00
orklah
3f7306d8df
Merge pull request #10254 from tuqqu/never-function-return-error-message
Fix error message for implicitly returning functions with `never` return type
2023-10-09 18:51:11 +02:00
klimick
a3df6505f0 Type check nested templates 2023-10-09 17:07:52 +03:00