1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00
Commit Graph

5408 Commits

Author SHA1 Message Date
Bruce Weirdan
1c2bc49838
Forbid non-null defaults for callable parameters
Fixes vimeo/psalm#3284
2023-02-16 01:36:06 -04:00
Bruce Weirdan
f70f6517a7
Merge pull request #9314 from weirdan/flag-unused-docblock-params
Flag docblock parameters that have no counterparts in function signature
2023-02-15 22:31:41 -04:00
Bruce Weirdan
1e71da3799
Merge pull request #9309 from othercorey/fix-memcached-callmap 2023-02-15 22:24:39 -04:00
Bruce Weirdan
0e9f04c55d
Merge pull request #9313 from othercorey/allow-ignored-callmap 2023-02-15 22:23:02 -04:00
Bruce Weirdan
e6aa63731d
Flag docblock parameters that have no counterparts in function signature
Fixes vimeo/psalm#3166
2023-02-15 22:04:26 -04:00
Corey Taylor
0598402620 Skip verifying callmaps based on name pattern 2023-02-15 20:00:04 -06:00
Bruce Weirdan
ee823619b8
Flag direct constructor calls
Fixes vimeo/psalm#2975
2023-02-15 20:14:00 -04:00
Corey Taylor
ab77cfd490 Fix memcached extension callmap 2023-02-15 17:26:58 -06:00
Bruce Weirdan
d6b75057a4
Fix test 2023-02-15 03:02:34 -04:00
Bruce Weirdan
8c491e93e8
Flag class constant references where LHS is ordinary string
Fixes vimeo/psalm#2185
2023-02-15 02:57:00 -04:00
Bruce Weirdan
3f2ecaec7e
Allow @var annotations on global vars
The actual code was extracted from `StaticAnalyzer`

Fixes vimeo/psalm#1111
2023-02-15 01:20:03 -04:00
Bruce Weirdan
a538439a87
Add option to skip callmap test
With this change, callmap tests can be skipped with
`--exclude-group=callmap`:

```console
$ php-noxdebug vendor/bin/paratest --passthru-php="-dmemory_limit=-1" --exclude-group=callmap
```
2023-02-15 00:30:45 -04:00
Bruce Weirdan
840250c534
Update expectations formatting
It's easier to read with consistent indentation
2023-02-14 21:59:01 -04:00
Bruce Weirdan
1ab02125b0
Added issue type and psalm.dev link to Emacs report
Fixes vimeo/psalm#8331
2023-02-14 21:19:29 -04:00
Bruce Weirdan
39c992c255
Emit issues for calls to is_a(string, class-string, false)
Fixes vimeo/psalm#4092
2023-02-14 02:25:46 -04:00
Bruce Weirdan
cee90fc071
Compare enum cases thoroughly
Fixes vimeo/psalm#7814
2023-02-13 22:39:33 -04:00
orklah
9921625691
Merge pull request #9278 from othercorey/fix-func-callmap
Fix remaining callmap functions
2023-02-13 07:10:43 +01:00
Corey Taylor
8fb290eb0d Fix remaining callmap functions 2023-02-12 23:10:09 -06:00
Bruce Weirdan
873d79c5d7
Forbid overriding built-in enum methods
Fixes vimeo/psalm#9274
2023-02-13 00:37:59 -04:00
orklah
5d1fe88d3f
Merge pull request #9272 from weirdan/forbid-extending-some-interfaces
Forbid implementing some interfaces
2023-02-12 08:38:54 +01:00
Corey Taylor
42e301cf84 Update callmap types for php 8.2 2023-02-12 01:24:43 -06:00
Bruce Weirdan
085e8f6fb2
Forbid implementing some interfaces
- `Throwable` can only be implemented when classes extend one of
  `Exception` or `Error`
- `UnitEnum` and `BackedEnum` cannot be implemented by user-defined
  classes

Refs vimeo/psalm#7722
2023-02-12 02:48:50 -04:00
Corey Taylor
9547a5cba5 Fix several callmap function signatures 2023-02-11 04:53:11 -06:00
Bruce Weirdan
85d4acf3b3
Fix crash when int range boundary is overflown
Fixes vimeo/psalm#9114
2023-02-09 22:57:57 -04:00
Bruce Weirdan
954136679a
Fix crashes with invalid @psalm-check-type syntax
Fixes vimeo/psalm#9201
2023-02-09 17:49:49 -04:00
Bruce Weirdan
1ee0f1bcb8
Merge pull request #9256 from othercorey/spoofchecker-callmap
fixes https://github.com/vimeo/psalm/issues/9254
2023-02-09 12:53:42 -04:00
Corey Taylor
b467a0a74e Fix Spoofchecker callmaps 2023-02-09 10:38:39 -06:00
Bruce Weirdan
250d4d593e
Don't crash on unknown exceptions in @throws docblock
Fixes vimeo/psalm#9248
2023-02-09 02:56:01 -04:00
Bruce Weirdan
3c4a829f71
Fixed more CS issues 2023-02-07 11:20:02 -04:00
Corey Taylor
e8ae1ec084 Convert callmaps resource types 2023-02-06 01:12:14 -06:00
Matthew Brown
d450b40da8
Remove some logic that didn't need to be there (#9209)
* Remove check to see what breaks

* Simplify following logic

* Add tests from @kkmuffme‘s branch

* Reduce scope of fix

* Clean up logic a little

* Add failing test

* Improvements

* Fix for non-Paradoxical Condition result
2023-02-03 21:08:16 -05:00
orklah
54cd529642
Merge pull request #9170 from mmcev106/filter-var-pure
Added @psalm-pure to filter_var()
2023-02-02 23:39:06 +01:00
Corey Taylor
f922e576c8 Fix xmlrpc callmap functions that were dropped in PHP 8.0 2023-02-02 12:21:31 -06:00
Bruce Weirdan
5d930a438a
Fix invalid test cases 2023-02-02 12:27:57 -04:00
Bruce Weirdan
fb65c79079
Fix newly discovered CS issues 2023-02-02 12:19:22 -04:00
Mark McEver
b5781c34e8 Fixed a case where the conditional taint, specialize, & flow features were not playing nicely together 2023-02-01 15:41:52 -06:00
Leo Viezens
7966fd574a
Merge branch 'master' into master 2023-01-30 15:38:29 +01:00
Alies Lapatsin
c55d297d0a Fix coding style issue 2023-01-29 18:52:09 +01:00
Alies Lapatsin
c75e4bdb28 Merge remote-tracking branch 'origin/unify-deprecation-messages' into unify-deprecation-messages 2023-01-29 18:32:55 +01:00
Alies Lapatsin
7526d60f2a Update assertion to reflect a new output
It reverts 588d9e08bc (diff-1ef46093f20172c4dc1cbe5a54e5b60c255082acd3f7c382dae621d8d23df404R172)
2023-01-29 18:32:31 +01:00
orklah
aec0edc618
Merge pull request #9177 from Nicelocal/duplicate_keys
Detect duplicate keys in array shapes
2023-01-25 18:37:22 +01:00
247d30f74c Detect duplicate keys in array shapes 2023-01-25 10:42:05 +01:00
shvlv
6227943bfb
Allow to scan private constants 2023-01-24 13:31:58 +02:00
shvlv
d6aff3ed20
Parse class constant for PhpStorm Meta override 2023-01-24 12:24:52 +02:00
Bruce Weirdan
70f2fb7d1b
Check $this in static closures
Fixes vimeo/psalm#9148
Fixes vimeo/psalm#2813
2023-01-23 05:16:12 -04:00
Bruce Weirdan
2af7f51394
Suppress warnings when --no-output is specified 2023-01-22 20:40:21 -04:00
Anner Visser
d86fcf4a85
Narrow ->value of enum case(s) to only the possible values
Using $stmt_var_type to determine if we're dealing with a subset of the
enum cases. If so, we only consider those cases for the possible values.

Fixes #8568
Fixes #8812
2023-01-21 12:05:24 +01:00
orklah
9e34de59cb
Merge pull request #9156 from vimeo/indent-docblocks-in-tests
Indent docblocks in DocComment test
2023-01-21 00:09:43 +01:00
Bruce Weirdan
bf99b76798
Indent docblocks in DocComment test
Since heredocs in PHP 7.3+ automatically strip leading whitespace we can
fix the formatting for this test.
2023-01-20 18:15:07 -04:00
Jack Worman
787b9ae687 Fix dom_import_simplexml() 2023-01-18 18:31:54 -05:00