1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-03 18:17:55 +01:00
Commit Graph

14097 Commits

Author SHA1 Message Date
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
Bruce Weirdan
294220c744
Merge pull request #10588 from issidorov/revert-auto-completion-filter 2024-01-27 07:06:52 -04: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
c0e8d32561
Merge pull request #10594 from edsrzf/encapsed-string-condition-order
Switch condition order
2024-01-25 19:32:48 +01:00
orklah
e72ad06343
Merge pull request #10593 from jorgsowa/update-baseline
Baseline update
2024-01-25 07:38:26 +01:00
Evan Shaw
68a1d1e2b4 Switch condition order
This change is for forward-compatibility with nikic/php-parser 5.0,
where `InterpolatedStringPart` (née `EncapsedStringPart`) is no longer an expression.
Thus we can't pass it to `NodeTypeProvider::getType()` anymore. Since that call
returns `null` anyway, we can swap the condition order. Everything still
works and Psalm type-checking is happy.

This also might be a tiny performance improvement since it lets the
common, cheap instanceof check come before a method call, but I haven't actually
benchmarked it.
2024-01-24 15:38:39 -10: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
orklah
9616b14253
Merge pull request #10574 from edsrzf/unit-test-improvements
Unit test improvements for php-parser 5
2024-01-24 23:59:23 +01:00
Jorg Sowa
17f4087418 Update psalm-baseline.xml 2024-01-24 22:43:40 +01:00
Bruce Weirdan
541bf51a25
Merge pull request #10584 from vimeo/dependabot/github_actions/actions/cache-4 2024-01-22 09:08:26 -04:00
klimick
c307bcbc76 Try to fix template replacement edge case 2024-01-22 13:36:08 +03:00
dependabot[bot]
786001547e
Bump actions/cache from 3 to 4
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-22 07:14:10 +00: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
b7a18bde46
Merge pull request #10572 from vimeo/fix_10552
Fix #10552
2024-01-18 20:40:16 +01:00
f7edaa66ac Fix #10552 2024-01-18 20:33:54 +01:00
3f284e96c9
Merge pull request #10568 from nicelocal/fix_array_keys
Fix template, conditional array keys
2024-01-18 13:15:06 +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
680c8cd39d
Merge pull request #10502 from kkmuffme/warn-for-non-strict-comparisons-on-truthy-falsy-types
report error for non-strict or empty comparison on truthy+falsy union
2024-01-17 13:00:11 +01:00
kkmuffme
a3a13241a7 fix baseline somehow incorrect paths 2024-01-17 12:41:58 +01:00
kkmuffme
4b41891829 update baseline 2024-01-15 10:33:46 +01:00
kkmuffme
f34ec2c81e change error level to 2 2024-01-15 10:11:22 +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
2414070849 simplify and remove redundant variable 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
63ea734f26 fix shepherd issue 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
c04eb4c96d
Merge pull request #10542 from kkmuffme/remove-duplicate-directory-separator-in-error-message
remove redundat directory separator which caused "//" in path not found errors
2024-01-14 23:41:06 +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
orklah
48ef3c474c
Merge pull request #10545 from kkmuffme/basename-dirname-return-type-more-specific
make basename & dirname return types more specific
2024-01-14 23:39:59 +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
kkmuffme
a2bf5cb054 Fix empty literal string becomes non-empty-string
when max literal string length is 0, which means literal strings are disabled
2024-01-13 16:23:16 +01:00
kkmuffme
6f184dca91 remove redundat directory separator which caused "//" in path not found errors 2024-01-13 12:17:24 +01:00
orklah
079bfb837c
Merge pull request #10543 from kkmuffme/fix-mb-get-info-wrong-type-failing-ci
Fix mb_get_info can return null - CI failing bc of reflection
2024-01-13 01:40:53 +01:00
kkmuffme
d209bab9f5 Fix mb_get_info can return null - CI failing bc of reflection
See https://github.com/php/php-src/issues/12753
2024-01-13 01:12:34 +01:00
orklah
5d1d5a2e57
Merge pull request #10540 from kkmuffme/make-getrandmax-type-more-specific
Make getrandmax type more specific and unserialize to require class-string
2024-01-11 19:46:18 +01:00
kkmuffme
7658fc4d33 unserialize change to class-string 2024-01-11 18:43:15 +01:00
kkmuffme
f04be62e8b can only be positive 2024-01-11 18:40:45 +01:00