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

14031 Commits

Author SHA1 Message Date
Claudio Zizza
4ec735e696
fix: add missing constructor parameter to IteratorIterator
The second parameter exist since PHP 5.1 and wasn't present in the docs before.
Even reflection wasn't showing this parameter until 8.0.
2023-04-13 00:14:26 +02:00
WhizSid
9e5266d6fe Add issue snippet 2023-04-13 01:15:09 +05:30
WhizSid
ae67589463 Fixed CI 2023-04-13 01:14:49 +05:30
WhizSid
b19c263fe5 Fixed non empty arg issue in array_splice function 2023-04-13 00:34:29 +05:30
Maximilian Bösing
c3f91992f1
bugfix: ensure object and arrays are not intersectable
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-04-12 10:21:32 +02:00
Maximilian Bösing
1071257245
refactor: resolve TTypeAlias in intersections
This also merges `TKeyedArray` into a one single keyed array. Therefore, this is not limited to aliases anymore.

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-04-11 23:22:04 +02:00
Maximilian Bösing
094df271a4
feature: add param and return type string to TCallableObject#getKey in case the callable is known
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-04-11 20:29:57 +02:00
Maximilian Bösing
e72af4ed07
feature: allow aliased types within intersection strings
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-04-11 20:29:31 +02:00
Maximilian Bösing
6ea4b56551
qa: introduce failing test for type-aliased intersection string
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-04-11 20:29:08 +02:00
Maximilian Bösing
93c71fe756
feature: introduce CallableTrait#getParamString and CallableTrait#getReturnTypeString
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-04-11 20:28:54 +02:00
orklah
71bb951717
Merge pull request #9632 from othercorey/fix-callmaps
Fix various db callmaps
2023-04-11 09:56:11 +02:00
Corey Taylor
282e3d3d72 Fix various db callmaps 2023-04-10 09:06:29 -05:00
orklah
2aaa577346
Merge pull request #9629 from boesing/bugfix/unused-closure-param-for-required-argument
Do not report required closure arguments as unused
2023-04-10 13:25:29 +02:00
orklah
9faf811520
Merge pull request #9630 from boesing/bugfix/issue-8787
Preserve `non-empty-string` type when combining literal and numeric strings
2023-04-10 10:15:57 +02:00
Maximilian Bösing
3f6a7de162
bugfix: preserve non-empty-string type when combining literal-string with numeric-string types
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-04-10 03:15:09 +02:00
Maximilian Bösing
10e7299501
qa: add failing test for issue #8787
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-04-10 02:43:31 +02:00
Maximilian Bösing
e5ae26d1e6
qa: raise php_version in ValidCodeAnalysisTestTrait and
`InvalidCodeAnalysisTestTrait`  to 7.4

This synchronizes with the minimum of the supported PHP versions via `composer.json` requirements.

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-04-10 02:03:44 +02:00
Maximilian Bösing
6d5f999c75
bugfix: do not report required closure arguments as unused
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-04-10 01:54:03 +02:00
Maximilian Bösing
707a0bac6c
qa: add another test to verify required arguments are not being reported
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-04-10 01:53:45 +02:00
Maximilian Bösing
3a9817aa74
qa: introduce failing test for #8095
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-04-10 00:53:50 +02:00
Maximilian Bösing
803786e44e
qa: restructure UnusedVariableTest
This aligns with most recent tests which do consume `InvalidCodeAnalysisTestTrait` and `ValidCodeAnalysisTestTrait`.

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-04-10 00:53:33 +02:00
orklah
763116fab3
Merge pull request #9599 from boesing/feature/callable-object-intersection
Introduce callable object intersection
2023-04-09 11:48:45 +02:00
Maximilian Bösing
b2b026439f
qa: correct character casing
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-04-08 21:50:29 +02:00
orklah
437fea965f
Merge pull request #9626 from ADmad/report-mixed-issues
Allow enabling mixed issues reporting for error levels > 2.
2023-04-08 10:44:32 +02:00
ADmad
a584314c62 Allow enabling mixed issues reporting for error levels > 2.
Refs #9619.
2023-04-08 06:17:00 +05:30
andrew
8c09d1678b Try to fix test ClassTemplateTest.templateStaticWithParam 2023-04-07 14:56:58 +03:00
andrew
d9ad8b420e Ignore specific callables (callable-array, callable-string) in the HighOrderFunctionArgHandler 2023-04-07 14:16:41 +03:00
andrew
2f7a7178ca Docs for HighOrderFunctionArgHandler::remapLowerBounds 2023-04-06 18:23:50 +03:00
andrew
7fba401fdd Callable type expansion for more readable error message 2023-04-06 15:29:59 +03:00
andrew
0456ef82a5 Prevent callable arg type enhancement for simple callable 2023-04-06 10:43:50 +03:00
andrew
d190b751fb Cleanup HighOrderFunctionArgHandler 2023-04-05 18:10:21 +03:00
Maximilian Bösing
a8ed8a7b5c
revert: class-string should not allow callable only
As per discussion with Ondřej, `class-string` should explicitly target objects.

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-04-05 14:51:50 +02:00
adrew
a3aed2fc61 Analyse const callable like first-class-callable 2023-04-04 22:17:17 +03:00
orklah
82b3a7c3d3
Merge pull request #9608 from jjjb03/patch-1
fix: treat includes starting with '.' and '..' correct
2023-04-04 20:36:21 +02:00
Johannes Boost
865e183fa0 fix: fix phpcs errors 2023-04-04 17:59:50 +02:00
Maximilian Bösing
0621ca6e70
qa: add additional test for class-string<callable-object>
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-04-04 17:43:35 +02:00
Maximilian Bösing
6c58d98d67
feature: treat class-string<callable> as callable-object
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-04-04 17:28:58 +02:00
Johannes
37976aa117 fix: treat includes starting with '.' and '..' correct 2023-04-04 17:28:45 +02:00
orklah
bf0740a58c
Merge pull request #9606 from orklah/edfghjhkjl
fix coercion detection between two keyed arrays
2023-04-04 12:59:55 +02:00
orklah
610d660cb0 add test 2023-04-04 12:22:41 +02:00
orklah
06e085cf3f fix coercion detection between two keyed arrays 2023-04-04 12:05:48 +02:00
Maximilian Bösing
b18fb9691b
qa: allow error_levels notation which is compatible with named arguments
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-04-03 23:23:28 +02:00
Maximilian Bösing
ee68f16bb6
feature: introduce callable-object intersection type object&callable
This allows devs to annotate that they expect a callable object.
In addition to this, it can also verify return and argument types.

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-04-03 23:23:28 +02:00
orklah
1f72597760
Merge pull request #9598 from orklah/fefefef
fix #9049
2023-04-03 14:35:35 +02:00
orklah
eb7be110ec fix level of error when comparing lists of mixed 2023-04-03 11:52:55 +02:00
orklah
cbf1afcdd3
Merge pull request #9601 from vimeo/dependabot/github_actions/mheap/github-action-required-labels-4
Bump mheap/github-action-required-labels from 3 to 4
2023-04-03 10:38:27 +02:00
dependabot[bot]
adad16e980
Bump mheap/github-action-required-labels from 3 to 4
Bumps [mheap/github-action-required-labels](https://github.com/mheap/github-action-required-labels) from 3 to 4.
- [Release notes](https://github.com/mheap/github-action-required-labels/releases)
- [Commits](https://github.com/mheap/github-action-required-labels/compare/v3...v4)

---
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-04-03 07:59:36 +00:00
Maximilian Bösing
11e90e7d42
qa: enhance code for better extensibility
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-04-03 02:23:59 +02:00
Maximilian Bösing
6ca34fdd10
qa: adjust code for readability
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2023-04-03 02:23:59 +02:00
orklah
87d0854a97
Merge pull request #9586 from boesing/feature/value-of-enum-assertions
Introduce `value-of` with backed enum cases in assertions
2023-04-02 18:51:25 +02:00