1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 09:37:59 +01:00
Commit Graph

14140 Commits

Author SHA1 Message Date
7d19f30961
Fix #10667 2024-02-06 23:35:18 +01:00
Bruce Weirdan
b54e0b2fd6
Merge pull request #10666 from weirdan/10662-strip-callmap-prefixes-from-parameter-names 2024-02-06 16:07:48 -04:00
Bruce Weirdan
2fc2a37ca0
Merge pull request #10665 from issidorov/parsing-magic-methods 2024-02-06 16:00:22 -04:00
Bruce Weirdan
1c36da6dda
Strip callmap prefixes from parameter names
Fixes vimeo/psalm#10662
2024-02-06 20:52:42 +01:00
Ivan Sidorov
afaaa3d6df Fix parsing magic method annotations
Fix parsing for code:

```
/**
 * @method static (string|int)[] getArray()
 * @method static (callable() : string) getCallable()
 */
class MyClass {}
```

Resolved tests:

```
1) testMethodAnnotation with data set "static (string|int)[] getArray()"
2) testMethodAnnotation with data set "static (callable() : string) getCallable()"
```
2024-02-06 17:01:28 +00:00
Ivan Sidorov
6b3380b05f Regression and fail tests
List fail tests:

```
1) testMethodAnnotation with data set "static (string|int)[] getArray()"
Undefined array key 0

/workspaces/psalm/tests/ClassLikeDocblockParserTest.php:201

2) testMethodAnnotation with data set "static (callable() : string) getCallable()"
Undefined array key 0

/workspaces/psalm/tests/ClassLikeDocblockParserTest.php:201
```
2024-02-06 17:01:28 +00:00
Bruce Weirdan
508da9abd4
Merge pull request #10661 from vimeo/10018-flag-stdclass-constructor-with-arguments 2024-02-05 20:31:26 -04:00
Bruce Weirdan
62b525993d
Flag stdClass::__construct() calls that have arguments
Fixes vimeo/psalm#10018
2024-02-06 01:24:18 +01:00
Bruce Weirdan
46217057a1
Merge pull request #10659 from weirdan/7395-suppress-UndefinedClass-in-whatever_exists 2024-02-05 15:58:25 -04:00
Bruce Weirdan
b822c3339d
Suppress UndefinedClass in whatever_exists()
Fixes vimeo/psalm#7395
2024-02-05 20:44:09 +01:00
Bruce Weirdan
f40e23faef
Merge pull request #10655 from weirdan/late-binding-of-enum-properties 2024-02-05 15:17:42 -04:00
Bruce Weirdan
5d671a4775
Merge pull request #10630 from kkmuffme/additional-fix-for-inconsistent-basedir 2024-02-05 15:01:51 -04:00
Bruce Weirdan
578046da4a
Merge pull request #10651 from edsrzf/missing-override 2024-02-05 07:16:40 -04:00
Bruce Weirdan
c40f232d31
Merge pull request #10629 from edsrzf/analyze-dynamic-fetches 2024-02-05 07:16:03 -04:00
Evan Shaw
4cec31eba9 Test for dynamic enum fetch 2024-02-05 21:56:30 +13:00
Evan Shaw
a827806709 ParseError for dynamic constants before PHP 8.3 2024-02-05 21:49:40 +13:00
kkmuffme
2008ea078a code review add die to forbidden functions for psalm itself 2024-02-05 08:19:23 +01:00
kkmuffme
ee7187c8d6 directory_separator optional wrong 2024-02-05 08:19:06 +01:00
Bruce Weirdan
ddb02b9e94
Merge pull request #10603 from weirdan/fix-existing_whatever-references 2024-02-05 01:05:38 -04:00
Bruce Weirdan
52eadab971
Late binding of enum cases
Resolves a number of long-standing bugs ('Failed to infer case value ...')

Fixes vimeo/psalm#10374
Fixes vimeo/psalm#10560
Fixes vimeo/psalm#10643
Fixes vimeo/psalm#8978
2024-02-05 04:12:19 +01:00
Bruce Weirdan
6d572a681c
Apply suggestions from code review 2024-02-04 20:43:08 +01:00
Bruce Weirdan
9ac2383efd
Merge pull request #10654 from weirdan/10650-do-not-add-callable-as-native-property-type 2024-02-04 15:32:59 -04:00
Bruce Weirdan
b2a2cd7884
Allow adding Closure as a native property type 2024-02-04 19:20:54 +01:00
Bruce Weirdan
e8b47f7d42
Do not add callable as a native property type
It's invalid in all PHP versions: https://3v4l.org/bXWo2

Also see php.net/manual/en/language.types.declarations.php#language.types.declarations.base.function

Fixes vimeo/psalm#10650
2024-02-04 18:52:20 +01:00
Evan Shaw
8396360d30 Emit MissingOverrideAttribute 2024-02-04 21:07:27 +13:00
Evan Shaw
c71ad2221c Move Override tests to separate file 2024-02-04 21:07:27 +13:00
Evan Shaw
7d07e258a3 Add MissingOverrideAttribute issue 2024-02-04 21:07:22 +13:00
Bruce Weirdan
59df6a728f
Merge pull request #10649 from weirdan/ci-clarify-pull-request-labels-check
Clarify that Pull request labels failure is to be resolved by maintainers
2024-02-03 19:09:29 -04:00
Bruce Weirdan
7c7c216b1b
Clarify that Pull request labels failure is to be resolved by maintainers 2024-02-03 23:07:52 +01:00
Bruce Weirdan
3b8d81b90e
Merge pull request #10644 from edsrzf/invalid-override 2024-02-03 18:05:10 -04:00
Evan Shaw
ea9cb44699 Emit InvalidOverride 2024-02-04 09:01:30 +13:00
Evan Shaw
07f4045ccd Add InvalidOverride issue 2024-02-04 09:01:30 +13:00
Bruce Weirdan
080c8f68bb
Merge pull request #10648 from robchett/check_type_namespace_allow_reserved_words 2024-02-03 15:11:38 -04:00
Bruce Weirdan
74314eb3b8
Merge pull request #10637 from UlrichEckhardt/fix/issue-10636-inotify-returntype 2024-02-03 15:05:26 -04:00
Bruce Weirdan
90362df23b
Merge pull request #10639 from simPod/diff 2024-02-03 15:01:10 -04:00
Bruce Weirdan
c1400b8ae7
Merge pull request #10647 from weirdan/drop-echo-checker-repo 2024-02-03 14:53:58 -04:00
robchett
9d4fd4011d Support user defined types for psalm-check-type 2024-02-03 18:26:20 +00:00
robchett
526013e77e Fix check-type when using reserved types from within a namespace 2024-02-03 18:09:23 +00:00
Bruce Weirdan
a2980b5924
Drop unused local composer repo
This was intended to show how you could convert legacy plugins to
composer format, but it breaks `composer install` in snapshots.
2024-02-03 18:44:24 +01:00
Bruce Weirdan
192f7b99a1
Merge pull request #10633 from weirdan/stable-baseline 2024-02-03 13:23:52 -04:00
Bruce Weirdan
9a970cafc3
Update our actual baseline to use the new format 2024-02-03 18:15:40 +01:00
Simon Podlipsky
4fc35949ef
Allow sebastian/diff v6 2024-02-02 10:22:38 +01:00
Ulrich Eckhardt
9fd17cf749 CallMap: Improve returntype annotation for inotify_read()
In case of success, it returns an array of associative arrays with defined fields:
- `wd` is a watch descriptor
- `mask` is a bit mask of events
- `cookie` is a unique id to connect related events
- `name` is the name of a file
2024-02-02 10:10:45 +01:00
Ulrich Eckhardt
1698239677 CallMap: Adjust return type for inotify_add_watch() to int|false
See https://github.com/vimeo/psalm/issues/10636
2024-02-02 09:35:25 +01:00
Bruce Weirdan
fc88ef2f67
Merge pull request #10634 from weirdan/10334-global-constants-as-case-values 2024-02-01 19:10:21 -04:00
kkmuffme
41ce826f6d improve file_put_contents return type 2024-02-01 20:11:06 +01:00
kkmuffme
d2e5a0722b improve realpath and readlink return type 2024-02-01 20:11:06 +01:00
kkmuffme
d79f77215b improve getcwd return type 2024-02-01 20:11:06 +01:00
kkmuffme
fae1d414fd fix errors output in stdout making test fails with cryptic errors 2024-02-01 20:11:06 +01:00
kkmuffme
47c52ad602 fix /src/psalm.xml not removed between tests and remove psalm.xml at the end of tests 2024-02-01 20:11:06 +01:00