Bruce Weirdan
52eadab971
Late binding of enum cases
...
Resolves a number of long-standing bugs ('Failed to infer case value ...')
Fixes vimeo/psalm#10374
Fixes vimeo/psalm#10560
Fixes vimeo/psalm#10643
Fixes vimeo/psalm#8978
2024-02-05 04:12:19 +01:00
Bruce Weirdan
6d572a681c
Apply suggestions from code review
2024-02-04 20:43:08 +01:00
Bruce Weirdan
b2a2cd7884
Allow adding Closure
as a native property type
2024-02-04 19:20:54 +01:00
Bruce Weirdan
e8b47f7d42
Do not add callable
as a native property type
...
It's invalid in all PHP versions: https://3v4l.org/bXWo2
Also see php.net/manual/en/language.types.declarations.php#language.types.declarations.base.function
Fixes vimeo/psalm#10650
2024-02-04 18:52:20 +01:00
Evan Shaw
8396360d30
Emit MissingOverrideAttribute
2024-02-04 21:07:27 +13:00
Evan Shaw
c71ad2221c
Move Override tests to separate file
2024-02-04 21:07:27 +13:00
Evan Shaw
7d07e258a3
Add MissingOverrideAttribute issue
2024-02-04 21:07:22 +13:00
Evan Shaw
ea9cb44699
Emit InvalidOverride
2024-02-04 09:01:30 +13:00
Evan Shaw
07f4045ccd
Add InvalidOverride issue
2024-02-04 09:01:30 +13:00
robchett
9d4fd4011d
Support user defined types for psalm-check-type
2024-02-03 18:26:20 +00:00
robchett
526013e77e
Fix check-type when using reserved types from within a namespace
2024-02-03 18:09:23 +00:00
kkmuffme
47c52ad602
fix /src/psalm.xml not removed between tests and remove psalm.xml at the end of tests
2024-02-01 20:11:06 +01:00
kkmuffme
d4a5909e1f
Fix additional places where base_dir was broken due to missing separator
...
Improves upon https://github.com/vimeo/psalm/pull/10542 and https://github.com/vimeo/psalm/pull/10628
2024-02-01 20:11:06 +01:00
robchett
421cb0f7a1
Allow enum cases to be global constants
2024-02-01 18:38:46 +01:00
Evan Shaw
88c2e00d02
Analyze dynamic class const names
2024-02-01 17:40:25 +13:00
Evan Shaw
a66aace523
Analyze dynamic static property names
2024-02-01 17:31:15 +13:00
Bruce Weirdan
6140f6881c
Allow typedef imports from any classlike type
...
All we really need is for the source to be autoloadable, and it includes
all classlikes (interfaces, classes, enums and traits at the time of
writing).
2024-01-31 23:07:23 +01:00
Bruce Weirdan
9ec556bb14
Allow inline comments in typedef shapes
...
Fixes vimeo/psalm#10492
2024-01-31 22:03:36 +01:00
kkmuffme
551625aa4b
Fix https://github.com/vimeo/psalm/issues/10561 numeric input incorrect return type
2024-01-31 14:11:10 +01:00
fluffycondor
6aa2ddfe1c
Fix ownerDocument type
2024-01-31 16:10:51 +06:00
Bruce Weirdan
6d32d2f692
Allow importing typedefs from enums
...
Fixes vimeo/psalm#10416
2024-01-30 20:29:51 +01:00
Bruce Weirdan
ca9a12ddda
Report MissingConstructor
for natively typed mixed properties
...
Fixes vimeo/psalm#10589
2024-01-30 17:24:27 +01:00
Bruce Weirdan
b2aebd90a7
Fix test by preloading interface
2024-01-29 22:43:05 +01:00
Bruce Weirdan
e8763968a0
Un-ignore arrayobject::getiterator - appears it's been fixed too
2024-01-29 22:43:05 +01:00
Bruce Weirdan
c935cc307b
Un-ignore recursiveiteratoriterator::__construct
2024-01-29 22:43:05 +01:00
Bruce Weirdan
58b7139470
Reflection may reference interfaces and enums
2024-01-29 22:43:05 +01:00
Bruce Weirdan
f045730927
Merge pull request #10598 from weirdan/key_exists-is-an-alias-for-array_key_exists
2024-01-29 16:23:35 -04:00
Bruce Weirdan
fd1294eef4
Merge pull request #10599 from weirdan/allow-properties-on-intersections-with-enum-interfaces
2024-01-29 16:23:20 -04:00
Bruce Weirdan
67a91e05b2
Do not validate callable arguments in lenient contexts
...
Fixes vimeo/psalm#10453
2024-01-27 16:38:37 +01:00
Bruce Weirdan
c1e22ddcaa
Allow properties on intersections with enum interfaces
...
Fixes vimeo/psalm#10585
2024-01-27 14:37:26 +01:00
Bruce Weirdan
6e2effaf9a
key_exists()
is an alias for array_key_exists()
...
Fixes vimeo/psalm#10346
2024-01-27 13:41:43 +01:00
Ivan Sidorov
10402c426b
Partial revert "Fix auto completion by partial property or method"
...
Filtering is not necessary. Clients using LSP should filter the results themselves.
That's what it says in the documentation.
This reverts commit d6faff2844
.
2024-01-26 12:23:36 +00:00
orklah
25b07fb6e2
Merge pull request #10586 from klimick/fix-template-replacement
...
Fix template replacement edge case
2024-01-25 00:00:36 +01:00
klimick
c307bcbc76
Try to fix template replacement edge case
2024-01-22 13:36:08 +03:00
Evan Shaw
d3eb02a93b
Fix ClassTest case
2024-01-19 16:59:45 +13:00
Evan Shaw
eb7ce32f40
Fix TemporaryUpdateTest cases
2024-01-19 16:59:38 +13:00
Evan Shaw
d17757c422
Fix PropertyTypeTest case
2024-01-19 16:59:33 +13:00
f7edaa66ac
Fix #10552
2024-01-18 20:33:54 +01:00
94efd67515
Improve tests
2024-01-18 13:10:32 +01:00
23543218dc
Fix template, conditional array keys
2024-01-18 12:59:56 +01:00
kkmuffme
5643cf53d4
fix mixed test not actually checking mixed (since superglobals have a more specific type now)
2024-01-15 10:11:22 +01:00
kkmuffme
dca17bcb6a
unrelated fix spelling
2024-01-15 10:11:22 +01:00
kkmuffme
93dc2219e0
fix bugs in tests
2024-01-15 10:11:22 +01:00
kkmuffme
19b1a33a20
fix possibly undefined array key in keyed array doesnt include null when not validated
...
Fix https://psalm.dev/r/b153d0d248 to return 'a'|null instead of 'a' - this is required as otherwise empty would report RedundantCondition errors now which would bring back https://github.com/vimeo/psalm/issues/2681
2024-01-15 10:11:22 +01:00
kkmuffme
fb93aede12
create a separate issue type
2024-01-15 10:11:21 +01:00
kkmuffme
f3543ca9ab
add the fix for empty() too and fix empty returning bool on true/false only cases hiding errors when functions called
2024-01-15 10:11:21 +01:00
kkmuffme
d5b713e439
Fix https://github.com/vimeo/psalm/issues/10501 - report error for non-strict comparison on truthy+falsy union
2024-01-15 10:11:21 +01:00
orklah
b9583493b0
Merge pull request #10499 from kkmuffme/fix-empty-string-becomes-non-empty-string-when-literal-strings-disabled
...
Fix empty literal string becomes non-empty-string
2024-01-14 23:41:50 +01:00
orklah
6e8692513a
Merge pull request #10544 from kkmuffme/improve-extract-variable-assignments
...
add support for extract to set variables for keyed arrays and respect EXTR_SKIP
2024-01-14 23:40:39 +01:00
kkmuffme
f940c029e1
make basename & dirname return types more specific
2024-01-14 19:01:46 +01:00
kkmuffme
02467fbb6a
add support for extract to set variables for keyed arrays and respect EXTR_SKIP
2024-01-14 10:54:02 +01:00
kkmuffme
4c54b68f30
code style
2024-01-13 17:12:41 +01:00
kkmuffme
7f0f0bc361
ensure concat https://psalm.dev/r/323e33ae8a will be a non-falsy-string
2024-01-13 17:10:19 +01:00
kkmuffme
4092618260
should be non-falsy-string instead of non-empty-string in most cases
2024-01-13 17:10:02 +01:00
orklah
26ae950085
Merge pull request #10536 from kthaler/simplexml-set-method
...
Implement __set method in SimpleXMLElement stub
2024-01-10 22:48:27 +01:00
Karl Thaler
138b47a04f
Omit property assignment tests for SimpleXMLElement
2024-01-10 13:07:32 -08:00
orklah
17cd6a7968
Merge pull request #10518 from samlitowitz/issue-10490
...
Deprecated Template Classes are not ignored by @psalm-suppress DeprecatedClass
2024-01-10 22:01:02 +01:00
orklah
06b71be009
Merge pull request #10508 from ging-dev/bugfixes
...
fix : #10496 #10503
2024-01-09 22:02:43 +01:00
orklah
b4ad9c00c5
Merge pull request #10505 from kkmuffme/fix-readonly-properties-by-reference-not-reported
...
Add error when using readonly property in by-ref arg
2024-01-09 22:01:51 +01:00
orklah
6c98f25a69
Merge pull request #10500 from kkmuffme/callable-without-args-union-not-handled-correctly
...
Fix callable without args not handled correctly
2024-01-09 21:58:14 +01:00
Sam L
1cb7dd9d72
Initial commit, issue-10490
...
Reproduce failure in unit test
2023-12-28 07:50:36 -05:00
ging-dev
5731f927fe
fix : #10496 #10503
2023-12-20 17:16:21 +07:00
kkmuffme
9e463bbe75
make tests work in PHP < 8.2
2023-12-19 11:37:14 +01:00
kkmuffme
1ff8518888
Fix https://github.com/vimeo/psalm/issues/9840
2023-12-19 11:07:11 +01:00
kkmuffme
f8a53ebc5d
Fix callable without args not handled correctly
2023-12-18 12:48:13 +01:00
kkmuffme
dee555daaf
filter_input & filter_var return type more specific
2023-12-17 20:34:10 +01:00
Antonio del Olmo
d6cf9faebb
Add support for Override attribute
2023-12-15 11:14:53 +01:00
orklah
3bc8cde539
Merge pull request #10488 from kkmuffme/invalidargument-false-not-true-param
...
add InvalidArgument error when passing false to true param
2023-12-13 18:48:51 +01:00
kkmuffme
d04694f4d4
Fix https://github.com/vimeo/psalm/issues/9267
2023-12-13 15:30:43 +01:00
kkmuffme
cceb1fb8c4
add missing phpdoc in new tests
2023-12-13 15:21:46 +01:00
kkmuffme
af3978281e
remove previously broken test https://github.com/vimeo/psalm/issues/10487
2023-12-13 15:05:48 +01:00
kkmuffme
e6f24d91fd
Fix https://psalm.dev/r/aada187f50 where 2 union types are not intersected and the condition contains both types
2023-12-13 14:10:22 +01:00
kkmuffme
108f626712
fix literal int/string comparisons only using one literal
...
Fix https://github.com/vimeo/psalm/issues/9552
2023-12-13 13:59:26 +01:00
kkmuffme
9be7fceb59
Fix literal string keys int not handled as int as PHP does
...
Fix https://github.com/vimeo/psalm/issues/8680
See also https://github.com/vimeo/psalm/issues/9295
2023-12-13 00:24:50 +01:00
kkmuffme
82ff582280
add error for invalid array key type in docblock
2023-12-13 00:23:14 +01:00
orklah
1df5b3580b
Merge pull request #10454 from kkmuffme/unsealed-not-nonempty-callable-param-should-be-valid
...
fix false positive ArgumentTypeCoercion for callback param
2023-12-12 21:26:24 +01:00
kkmuffme
3c045b30a7
fix false positive ArgumentTypeCoercion for callback param when unsealed and all optional
2023-12-12 14:13:32 +01:00
kkmuffme
20ae081ee1
fix psalm v4 hardcoded in tests
2023-12-12 07:51:21 +01:00
kkmuffme
5fccb33938
dont combine empty string with numeric-string
...
Fix https://github.com/vimeo/psalm/issues/6646
2023-12-07 20:05:16 +01:00
orklah
f4e9837e27
Merge pull request #10450 from nicelocal/fix_class_string_key
...
Fix shaped array class string key combination
2023-12-07 17:52:15 +01:00
576ecd66e6
Fix #10460
2023-12-07 17:29:22 +01:00
0d3485b588
Commit just first part of fix for now
2023-12-07 13:04:59 +01:00
76458e0b50
Add test
2023-12-06 14:52:54 +01:00
4ed0fe934f
Fix shaped array class string key combination
2023-12-06 14:12:19 +01:00
390df68966
Merge branch '5.x' into fix_literal_union_key
2023-12-03 20:55:05 +01:00
37cf82ea52
Merge branch '5.x' into fix_literal_union_key
2023-12-03 20:50:05 +01:00
75633cbc6d
Merge remote-tracking branch 'hub/5.x' into byref_closure_use
2023-12-03 20:47:51 +01:00
18a6c0b6e9
Implement by-ref closure use analysis
2023-12-03 15:28:51 +01:00
b03b846682
Emit UnusedPsalmSuppress issues for suppressed issues already removed by plugins
2023-12-03 11:45:17 +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
0aeb87c21c
Simplify
2023-12-01 17:57:50 +01:00
17bf9a45a6
Fixup
2023-12-01 17:46:24 +01:00
147129345e
Add failing test
2023-12-01 17:23:35 +01:00
ead2908464
Fixup tests
2023-12-01 17:05:23 +01:00
f652cf09d8
Merge branch 'fix_array_key_exists_negation' into fix_literal_union_key
2023-12-01 16:31:24 +01:00
1a4656564a
Cleanup
2023-12-01 16:31:01 +01:00
ab3a17b7b0
Fix
2023-12-01 16:11:14 +01:00
2e249ab3fa
Create keyed arrays when assigning literal union keys
2023-12-01 16:03:08 +01:00
ef169893aa
cs-fix
2023-12-01 15:07:55 +01:00
cab7cf0330
Fix
2023-12-01 15:03:24 +01:00