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

5437 Commits

Author SHA1 Message Date
Evan Shaw
f7eaa5daec Preserve PossiblyUndefinedVariable when fixing UnusedVariable 2023-02-25 20:08:01 +13:00
Bruce Weirdan
caac14c4a4
Consistently report docblock issues on all classlikes
Fixes vimeo/psalm#9365
2023-02-24 03:31:00 -04:00
Bruce Weirdan
5f59f07163
Allow array as magic method name
Fixes vimeo/psalm#9321
2023-02-24 02:23:09 -04:00
Bruce Weirdan
3f52ded9c3
Correctly process use aliases in @psalm-scope-this
Fixes vimeo/psalm#9386
2023-02-24 00:53:36 -04:00
Corey Taylor
74a67a0416 Update Phar callmaps 2023-02-23 21:02:24 -06:00
Bruce Weirdan
2315c98a73
Merge pull request #9381 from weirdan/enforce-literal-string-length-limit 2023-02-23 16:47:53 -04:00
Yannick Gottschalk
f026226aa3 Fixes #9384 2023-02-23 17:23:46 +01:00
Bruce Weirdan
f4e66a0fbf
Add test 2023-02-23 04:01:29 -04:00
Bruce Weirdan
e96a929451
Merge pull request #9383 from weirdan/process-psalm-api-on-methods 2023-02-23 04:00:42 -04:00
Bruce Weirdan
2e90cb6c6a
Process @psalm-api tags on methods 2023-02-23 03:52:10 -04:00
Bruce Weirdan
d0a14005a8
Merge pull request #9380 from weirdan/array-in-foreach-is-not-empty 2023-02-23 02:20:46 -04:00
Bruce Weirdan
1769f8b9a4
Refine arrays in foreach loops to non-empty-array
Fixes vimeo/psalm#9378
2023-02-22 20:44:50 -04:00
Javier Sanahuja
4f83324a91 Support sizeof alias of count 2023-02-22 23:11:10 +01:00
Ulrich Eckhardt
4596301290 FFI Stubs: Define a set of tests.
Mostly, those are derived from examples from the documentation.
2023-02-21 23:08:58 +01:00
Bruce Weirdan
c46eccda76
Merge pull request #9358 from weirdan/revert-8761 2023-02-21 02:57:53 -04:00
Corey Taylor
c62465ceef Fix several spl callmap methods 2023-02-20 22:30:21 -06:00
Bruce Weirdan
01c19d94ba
Added a bunch of tests from referenced issues 2023-02-20 23:45:01 -04:00
Bruce Weirdan
ac86981a79
Revert "#7387 Add asserting non-empty-string by strlen"
This reverts commit 0ef7ec100a.
2023-02-20 23:07:22 -04:00
Evan Shaw
a03299f3d0 Include setrawcookie as an impure function 2023-02-21 14:24:05 +13:00
Ismail Turan
bec8ddf525 fix (DateTime|DateTimeImmutable)::modify() return types
vimeo#9042 caused issues to any called method on an instance
of DateTime|DateTimeImmutable after calling the modify
method.

This fixes vimeo#9171
2023-02-20 08:47:05 +01:00
Bruce Weirdan
38cc316ce9
Update tests/TypeReconciliation/ConditionalTest.php 2023-02-19 06:02:12 -04:00
Evan Shaw
a25fe35584 Negated is_numeric narrows scalar type 2023-02-19 22:38:34 +13:00
Bruce Weirdan
863f15ab15
Merge pull request #9337 from weirdan/validate-test-environment 2023-02-19 04:35:11 -04:00
Bruce Weirdan
73bad8967d
Forbid first-class callables in new
It's an invalid construct in PHP, not rejected by PHPParser for some
reaason.

Fixes vimeo/psalm#9335
2023-02-19 04:18:32 -04:00
Bruce Weirdan
236c1a8ae5
Added the test to validate test environment itself
We should make sure that the environment the tests are run is as strict
as possible. For example, zend.assertions should be enabled.
2023-02-19 03:52:12 -04:00
Evan Shaw
d4a57c863c Enable store_node_types for all test cases 2023-02-19 19:52:45 +13:00
Evan Shaw
c8393bd50d Fix language server first-class callable crashes 2023-02-19 14:18:17 +13:00
Bruce Weirdan
4f22c2e7c6
Propagate phantom classes to closure context
Fixes vimeo/psalm#9317
2023-02-18 01:52:10 -04:00
Corey Taylor
e813a54d03 Skip verifying memcache extension callmap 2023-02-17 01:27:37 -06:00
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