Bruce Weirdan
87e2af43f5
Use PHP_VERSION_ID
instead of version_compare()
...
As we do elsewhere
2024-03-03 15:21:22 +01:00
Bruce Weirdan
64a32721e3
Allow the test fixed in vimeo/psalm#10778
2024-03-03 15:16:39 +01:00
kkmuffme
0975c156af
set previous default setting for failing test temporarily
...
Refs https://github.com/vimeo/psalm/issues/10773
2024-03-03 15:10:03 +01:00
kkmuffme
963feb91a7
fix PHP 8 tests running with wrong --php-version=/phpVersion= if not explicitly specified
2024-03-03 15:10:03 +01:00
Bruce Weirdan
9e905ec21d
Merge pull request #10778 from weirdan/10773-fix-weakmap-iteration
2024-03-03 15:09:44 +01:00
Bruce Weirdan
edc123b219
Backport WeakMap
iterator fix from master
...
Refs vimeo/psalm#10773
2024-03-03 13:45:25 +01:00
Bruce Weirdan
20e8604b0c
Merge pull request #10772 from weirdan/10766-named-parameters-for-callables
2024-03-02 20:01:32 +01:00
Bruce Weirdan
ceb290891b
Initial support for named parameters for callables
...
Fixes vimeo/psalm#10766
2024-03-02 19:17:48 +01:00
Bruce Weirdan
cabcb02614
Merge pull request #10765 from theodorejb/avoid-duplication
2024-03-02 15:52:52 +01:00
Bruce Weirdan
d3e070c89e
Merge pull request #10769 from kkmuffme/since-annotations-outside-phpstub-should-not-infer-php-version
2024-03-02 14:14:48 +01:00
kkmuffme
a1848a1a14
@since annotations should only infer PHP version in .phpstub files or for @since 8.0.0 PHP
...
Fix https://github.com/vimeo/psalm/issues/10761
2024-03-02 11:52:51 +01:00
kkmuffme
d751c202d8
fix unrelated Config bug not honoring PHP composer versions 8.2 + 8.3
2024-03-02 11:50:52 +01:00
Theodore Brown
e357b972f6
Avoid duplicating code for RiskyTruthyFalsyComparison
2024-02-29 20:38:40 -06:00
Bruce Weirdan
496b214671
Merge pull request #10764 from weirdan/fix-since-version-comparison
2024-03-01 03:03:19 +01:00
Bruce Weirdan
97b22ecdfd
Fix version comparison for @since
...
Refs vimeo/psalm#10761
2024-03-01 01:37:33 +01:00
Bruce Weirdan
8bdf114b9a
Merge pull request #10760 from kkmuffme/fix-crash-invalid-taint-escape
2024-03-01 00:35:07 +01:00
kkmuffme
52fb472207
Fix PHP notice - crash on invalid taint-escape
2024-02-29 17:54:51 +01:00
Bruce Weirdan
9aa450bbe6
Merge pull request #10753 from edsrzf/arguments-isset-disable
2024-02-27 16:50:20 +01:00
Evan Shaw
22f32c1392
Set inside_isset = false when analyzing arguments
2024-02-27 22:30:10 +13:00
Bruce Weirdan
60badd0a93
Merge pull request #10752 from edsrzf/array-isset-disable-dim
2024-02-27 01:11:12 +01:00
Bruce Weirdan
a1352eb647
Merge pull request #10697 from weirdan/forbid-iterating-over-generators-with-non-nullable-send
2024-02-27 01:10:14 +01:00
Bruce Weirdan
0ce62a51ec
Let's see what breaks without this hack
2024-02-27 01:04:03 +01:00
Bruce Weirdan
4eec8bb5e8
Disabled wrong test
2024-02-27 01:04:03 +01:00
Bruce Weirdan
27461c98f6
Strip null used to signify completed iterations in foreach context
...
Even though `Generator::current()` can return `null` once generator is
exhausted, `foreach()` never iterates after iterator ends, so we can
safely remove `null` (unless, of course, generator can yield `null`).
2024-02-27 01:04:03 +01:00
Bruce Weirdan
8a0bc19fa6
Forbid iterating over generators with non-nullable send()
...
Fixes vimeo/psalm#6985
2024-02-27 01:04:03 +01:00
Bruce Weirdan
e9ea999f50
Merge pull request #10738 from MelechMizrachi/vimeo-fix-long-array-consts-false-flag
2024-02-27 00:40:20 +01:00
Evan Shaw
3535324842
Fix new errors
2024-02-26 21:47:05 +13:00
Evan Shaw
10ed0f3cd6
Set inside_isset false when analyzing ArrayDimFetch dim
2024-02-26 21:47:05 +13:00
Bruce Weirdan
71707e6c4e
Merge pull request #10748 from weirdan/10747-fix-loading-stubs-from-phar-on-windows
...
Fix loading stubs from phar file on Windows
2024-02-25 14:35:17 +01:00
Bruce Weirdan
eb9e8d96cf
Merge pull request #10749 from weirdan/6449-skip-symlink-test-on-windows
...
Skip symlink test on Windows
2024-02-25 14:34:30 +01:00
Bruce Weirdan
57caade0d1
Skip symlink test on Windows
...
Fixes vimeo/psalm#6449
Symlinks on Windows are rare (and quite unreliable)
2024-02-25 14:29:20 +01:00
Bruce Weirdan
01dc2fef84
Fix loading stubs from phar file on Windows
...
Fixes vimeo/psalm#10747
2024-02-25 13:58:32 +01:00
Bruce Weirdan
6c10ad2355
Merge pull request #10746 from ohader/taint-kind-const-5.x
...
Use TaintKind/TaintKindGroup constants instead of string values
2024-02-25 11:11:55 +01:00
Oliver Hader
de7b65ea8a
Use TaintKind/TaintKindGroup constants instead of string values
2024-02-24 16:31:52 +01:00
Melech Mizrachi
f553392454
Fix a false flag issue with InvalidConstantAssignmentValue being thrown for constants over a certain length. Usually happens with arrays or lists over 100+ entries in length.
...
Check if this type was defined via a dockblock or type hint otherwise the inferred type should always match the assigned type, and we don't even need to do additional checks
There is an issue with constants over a certain length where additional values are added to fallback_params in the assigned_type but not in const_storage_type which causes a false flag for this error to appear. Usually happens with arrays/lists.
Added two separate tests to cover both lists, and arrays to ensure this issue is fixed.
2024-02-23 11:25:34 -07:00
Bruce Weirdan
eeffee7aae
Merge branch '5.22.x' into 5.x
2024-02-23 00:41:03 +01:00
Bruce Weirdan
d768d91415
Merge pull request #10720 from vimeo/10706-catch-intersection-exceptions-during-scanning
2024-02-22 19:39:07 -04:00
Oliver Hader
4b827d3847
Add more tests for native intersection types in class properties
2024-02-23 00:33:46 +01:00
Bruce Weirdan
7bd35be5d5
Catch missing classlike exceptions during scanning
...
This may resolve #10706 , although I'm not exactly convinced it's the
best way.
2024-02-23 00:33:42 +01:00
Bruce Weirdan
4a5f433831
Merge pull request #10729 from ohader/revert-10242-5.x
2024-02-21 17:07:02 -04:00
Bruce Weirdan
2b642804b7
Merge pull request #10734 from weirdan/override-attribute-in-pure-context
...
Allow `Override` attribute to be used in pure contexts
2024-02-21 15:55:32 -04:00
Bruce Weirdan
3cd9658d29
Allow Override
attribute to be used in pure contexts
...
Fixes vimeo/psalm#10731
2024-02-21 12:25:30 +01:00
Bruce Weirdan
c401490265
Merge pull request #10733 from kkmuffme/fix-false-positive-riskytruthyfalsycomparison
2024-02-21 07:03:07 -04:00
kkmuffme
e482c078a7
code style whitespace fixes including for unrelated tests
2024-02-20 22:28:12 +01:00
kkmuffme
9d8080096c
Fix RiskyTruthyFalsyComparison reporting irrelevant errors when there is no explicit truthy/falsy type
2024-02-20 22:28:12 +01:00
Oliver Hader
679aaf0939
Revert "Allow tainted numerics except for 'html' and 'has_quotes'"
2024-02-20 13:55:31 +01:00
Bruce Weirdan
503ccd8235
Merge pull request #10722 from kkmuffme/fix-uppercase-non-empty-lowercase-and-falsy-in-loop
2024-02-20 07:07:09 -04:00
Bruce Weirdan
6129891cc7
Merge pull request #10728 from ohader/10725-before-file-analysis-event-stmts
2024-02-19 19:37:42 -04:00
Oliver Hader
1ff41e68a0
Drop superfluous fetching of statements from event
2024-02-20 00:22:14 +01:00
Oliver Hader
2943cfe11d
Add list of statements to BeforeFileAnalysisEvent
...
Fixes : #10725
2024-02-20 00:00:27 +01:00