1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-04 10:38:49 +01:00
Commit Graph

12425 Commits

Author SHA1 Message Date
Bruce Weirdan
afb8c8891b
fix I::cases() where interface I extends BackedEnum
Fixes vimeo/psalm#9065

Inheritance in stubs seems to be broken
2023-01-05 21:35:47 -04:00
Bruce Weirdan
8329309999
Merge pull request #9063 from lptn/use-more-specific-types 2023-01-05 17:20:41 -04:00
Alies Lapatsin
f197d137d6 Internal: use more specific types 2023-01-06 00:27:01 +04:00
orklah
7d6a48ab14
Merge pull request #9044 from kkmuffme/absolute-autoloader-path-not-working
fix autoloader not working with absolute path
2023-01-04 22:11:38 +01:00
orklah
9d2179f9ed
Merge pull request #9055 from kukulich/patch-7
Fix `ReflectionClass` stub
2023-01-04 00:09:57 +01:00
Jaroslav Hanslík
65cf669bff
Fix ReflectionClass stub 2023-01-03 23:55:59 +01:00
orklah
e527c68706
Merge pull request #9051 from kukulich/patch-4
Fix `ReflectionClass::getTraitNames()` stub
2023-01-03 23:17:48 +01:00
orklah
f978594157
Merge pull request #9052 from kukulich/patch-5
Fix `ReflectionMethod::getModifiers()` stub
2023-01-03 23:17:09 +01:00
orklah
0ec0fcf676
Merge pull request #9053 from kukulich/patch-6
Fix `ReflectionFunctionAbstract::getExtensionName()` stub
2023-01-03 23:16:17 +01:00
Jaroslav Hanslík
cbea438a23
Fix ReflectionFunctionAbstract::getExtensionName() stub 2023-01-03 22:16:58 +01:00
Jaroslav Hanslík
4f8f233e76
Fix ReflectionMethod::getModifiers() stub 2023-01-03 22:08:36 +01:00
Jaroslav Hanslík
2310c1361d
Fix ReflectionClass::getTraitNames() stub 2023-01-03 21:46:47 +01:00
orklah
3560ef7717
Merge pull request #9046 from kukulich/patch-1
Fix `ReflectionClass::getTraitAliases()` stub
2023-01-03 21:05:17 +01:00
orklah
7cde3c33d2
Merge pull request #9048 from kukulich/patch-3
Fix `ReflectionClass::getReflectionConstants()` stub
2023-01-03 21:04:49 +01:00
orklah
885f5375c5
Merge pull request #9047 from kukulich/patch-2
Fix `ReflectionClass::getModifiers()` stub
2023-01-03 21:03:42 +01:00
Jaroslav Hanslík
9ebefcef7d
Fix ReflectionClass::getReflectionConstants() stub 2023-01-03 18:20:08 +01:00
Jaroslav Hanslík
865a824818
Fix ReflectionClass::getModifiers() stub 2023-01-03 18:15:56 +01:00
Jaroslav Hanslík
415ef8fc75
Fix ReflectionClass::getTraitAliases() stub 2023-01-03 17:58:53 +01:00
Bruce Weirdan
7029e76f5e
Merge pull request #9043 from pilif/fix-9042
fixes https://github.com/vimeo/psalm/issues/9042
2023-01-03 11:46:54 -04:00
kkmuffme
1a0c0fe5c5 relative path as absolute paths autoloader legacy issue 2023-01-03 15:35:57 +01:00
kkmuffme
76f90e62f2 code style 2023-01-03 15:21:15 +01:00
kkmuffme
8fe00cf609 fix autoloader not working with absolute path 2023-01-03 15:13:38 +01:00
Philip Hofstetter
bab17568dc
fix DateTime::modify() and DateTimeImmutable::modify() return types
even though the two methods return types are documented as returning
their respective types, in PHP they are in-fact returning `static`
internally in all versions of PHP currently supported by psalm.

This fixes #9042
2023-01-03 12:11:38 +01:00
orklah
c6cfa86f35
Merge pull request #9039 from vimeo/dependabot/github_actions/mheap/github-action-required-labels-3
Bump mheap/github-action-required-labels from 2 to 3
2023-01-02 18:24:15 +01:00
dependabot[bot]
478422e010
Bump mheap/github-action-required-labels from 2 to 3
Bumps [mheap/github-action-required-labels](https://github.com/mheap/github-action-required-labels) from 2 to 3.
- [Release notes](https://github.com/mheap/github-action-required-labels/releases)
- [Commits](https://github.com/mheap/github-action-required-labels/compare/v2...v3)

---
updated-dependencies:
- dependency-name: mheap/github-action-required-labels
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-02 07:04:00 +00:00
orklah
e81823e193
Merge pull request #9035 from othercorey/iterator-returns
Fix iterator and exception callmaps
2023-01-01 11:22:39 +01:00
Corey Taylor
e779c5f741 Fix iterator and exception callmaps 2022-12-31 11:34:48 -06:00
orklah
ef1264bd46
Merge pull request #9030 from kkmuffme/psalm-scope-this-doesnt-work-with-FQCN-leading-backslash
fix @psalm-scope-this not working with FQCN with leading backslash
2022-12-31 12:08:20 +01:00
kkmuffme
82f71a7ccb add test 2022-12-31 00:18:08 +01:00
orklah
01078766bb
Merge pull request #9033 from danog/misc_fixes
Fix remaining markdown issues
2022-12-30 22:59:52 +01:00
0f7eed0dca fixes 2022-12-30 21:51:27 +01:00
9b4857a606 Fix 2022-12-30 21:48:28 +01:00
2a7043a7fb Fix remaining markdown header 2022-12-30 21:46:54 +01:00
orklah
406946d4c4
Merge pull request #9031 from danog/misc_fixes
Misc fixes
2022-12-30 21:28:11 +01:00
4b00095b31 cs-fix 2022-12-30 21:06:03 +01:00
9684be9d73 More markdown fixes 2022-12-30 21:02:59 +01:00
0b67844420 Improve variable naming and improve docs 2022-12-30 21:00:38 +01:00
kkmuffme
fcf42840f3 fix @psalm-scope-this not working with FQCN with leading backslash 2022-12-30 18:30:31 +01:00
orklah
6353143eaf
Merge pull request #9021 from orklah/nonempty-reconcile
Non empty reconciliation
2022-12-29 22:35:12 +01:00
orklah
2efa6aefac
Merge pull request #9025 from kkmuffme/fix-method-phpdoc-errors-reported-for-stubs-instead-of-files
fixes return type issues of methods reported for the wrong file
2022-12-29 20:13:38 +01:00
orklah
5a6e8cb8e7
Merge pull request #9023 from kkmuffme/fix-union-never-wrong-return-type
Fix never return union type wrong condition
2022-12-29 20:11:38 +01:00
orklah
0101a9f483
Merge pull request #9024 from kkmuffme/fix-never-method-calls
fix never return for MethodCalls
2022-12-29 20:11:10 +01:00
kkmuffme
9130ee2614 fixes return type issues of methods reported for the wrong file
fixes return type issues of methods reported for the wrong file

Fix #8457

See https://github.com/vimeo/psalm/pull/8503 which fixed this issue for functions
2022-12-29 18:55:15 +01:00
kkmuffme
ac8f892d13 Fix never return union type wrong condition
Fix never return union type wrong condition

Related https://github.com/vimeo/psalm/pull/8624
2022-12-29 18:50:58 +01:00
kkmuffme
efc87277d1 fix never return for MethodCalls
Related:
https://github.com/vimeo/psalm/pull/8902 https://github.com/vimeo/psalm/pull/8624
2022-12-29 18:49:58 +01:00
orklah
5bfb87c624
Merge pull request #9022 from Ocramius/fix/#8983-allow-large-union-types-in-array-type-inference
Better type inference and type checking for large union types used in array keys/values
2022-12-29 10:48:05 +01:00
orklah
790c30959d
Merge pull request #9016 from Ocramius/feature/#5039-more-refined-types-for-explode-core-function
Refined `explode()` types
2022-12-29 10:23:18 +01:00
Marco Pivetta
e6600fea21 Better type inference and type checking for large union types used in array keys/values
Fixes #8983

This patch adds a basic test showing that, when reaching a union type with 30 elements
or more, Psalm used to fail with an error, because the large union type got simplified
into a more general type as part of performance optimizations done in `TypeCombiner::combine()`.

This means that a type like `array<1|2|3|(etcetera...)|100, mixed>` was internally
simplified to `array<int, mixed>`, after reaching 30 elements or more, which in turn
led to problems and confusing errors when large union types are in play.

Such union types are relatively common in lookup-table-alike value objects.

By removing the hardcoded call-time limit of `30` types to be combined, we hereby
rely on the default `TypeCombiner::combine()` limit of `500` items, which is more
healthy.

This may come with some performance implications, but it is worth trying out, for
now.

Further parameters passed to `TypeCombiner::combine()` that were already matching
parameter default values were also omitted from the call-sites.
2022-12-29 10:05:23 +01:00
orklah
907729d83a remove useless imports 2022-12-29 01:00:06 +01:00
orklah
ee98fac581 use Atomic to create the types 2022-12-29 00:51:09 +01:00