kkmuffme
7023855fb3
add scalar & numeric handling for all cases where appropriate and ensure no more generic types being added for int/float (previous commit)
2024-01-31 14:19:53 +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
Bruce Weirdan
abe7ae828d
Merge pull request #10619 from fluffycondor/fix-ownerdocument-null
2024-01-31 06:48:34 -04:00
fluffycondor
6aa2ddfe1c
Fix ownerDocument type
2024-01-31 16:10:51 +06:00
Bruce Weirdan
04ba9358e3
Merge pull request #10605 from edsrzf/php-parser-tweaks
2024-01-30 18:52:27 -04:00
Bruce Weirdan
35e6effa12
Merge pull request #10617 from weirdan/10416-import-typedefs-from-enums
2024-01-30 16:39:33 -04:00
Bruce Weirdan
6d32d2f692
Allow importing typedefs from enums
...
Fixes vimeo/psalm#10416
2024-01-30 20:29:51 +01:00
Bruce Weirdan
baa866029e
Merge pull request #10615 from weirdan/10589-fix-missing-MissingConstructor-with-native-mixed-property
2024-01-30 12:47:59 -04: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
e02276a17f
Merge pull request #10614 from weirdan/fix-json-mapping-with-opcache.save_comments-0
2024-01-30 00:06:11 -04:00
Bruce Weirdan
98756ba992
Fix language server running with opcache.save_comments=0
...
Fixes vimeo/psalm#10353
2024-01-30 04:59:12 +01:00
Bruce Weirdan
e63db9c12a
Drop suppression as the method is now used in tests
2024-01-29 22:43:06 +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
67ba758c09
Fix unstable hasFullyQualified(Interface|Enum)()
...
Before this change, calling:
```php
$classlikes->hasFullyQualifiedInterfaceName($i); // true
$classlikes->hasFullyQualifiedClassName($i); // false
$classlikes->hasFullyQualifiedInterfaceName($i); // false
```
would result in the last call returning `false`
2024-01-29 22:42:58 +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
8354ff3014
Merge pull request #10600 from weirdan/readgzfile-is-impure
2024-01-29 16:23:05 -04:00
Bruce Weirdan
872cf58236
Merge pull request #10601 from weirdan/do-not-validate-callable-arguments-in-lenient-contexts
2024-01-29 16:22:47 -04:00
Bruce Weirdan
79b67f8b81
Merge pull request #10612 from edsrzf/rework-trivial-expr
2024-01-28 21:35:34 -04:00
Evan Shaw
98d98be443
Re-work CheckTrivialExprVisitor
...
In php-parser 5.0, `ClosureUse` is no longer considered an expression.
This requires changes to Psalm's `CheckTrivialExprVisitor`, which stores
an array of "non-trivial" `Expr` nodes.
However the only use of this array is to count whether or not it's
empty. Instead of keeping the array, we can keep a boolean, and avoid
needing to change the types in this class when we upgrade to php-parser
5.0.
2024-01-29 13:25:25 +13:00
Bruce Weirdan
45f3218fad
Merge pull request #10607 from weirdan/lsp-issue-type-in-description
...
[LSP] Add issue type in description
2024-01-28 15:05:32 -04:00
Bruce Weirdan
4b2cd0f23f
[LSP] Add issue type in description
...
Fixes psalm/psalm-vscode-plugin#287
2024-01-28 16:36:03 +01:00
Evan Shaw
f1a206fbf5
Remove usages of deprecated getLine
2024-01-28 14:32:14 +13:00
Evan Shaw
361ba65af0
Use flags key instead of type for ClassMethod
2024-01-28 14:12:26 +13: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
9372adb980
readgzfile()
is impure
...
Fixes vimeo/psalm#10528
2024-01-27 15:38:27 +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
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