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

4221 Commits

Author SHA1 Message Date
Alessandro Lai
55cbbd4fe7
Add test 2021-09-09 16:04:12 +02:00
Bruce Weirdan
beb0476eed
Added test 2021-09-08 22:41:23 +03:00
Bruce Weirdan
b4f024b1fe
Basic enum checks
* Duplicate cases
* Duplicate case values
* Invalid case values: value on a pure enum case, missing value on a
backed enum case, backing type / case type mismatch
* Literal expression evaluation for case values

Fixes vimeo/psalm#6426
Fixes vimeo/psalm#6427
2021-09-07 12:35:38 +03:00
Bruce Weirdan
b39e765475
Prevent failures with dev PHP versions
It was failing with dev versions, e.g. `8.2.0-dev`
2021-09-07 01:43:03 +03:00
Nicolas Giraud
9df0edbbab Force array_walk to not infer input type. 2021-09-06 15:15:25 +02:00
Bruce Weirdan
0f2152ac97
Merge pull request #6434 from weirdan/flag-invalid-enum-backing-type
Flag invalid backing types for enums
2021-09-05 20:30:01 +03:00
Bruce Weirdan
7b11024886
Flag invalid backing types for enums
Fixes vimeo/psalm#6428
2021-09-05 20:12:24 +03:00
Bruce Weirdan
abf557da44
Encode XML output consistently
This fixes test failures when running on PHP 8.1, due to changed
`htmlspecialchars()` defaults
2021-09-05 20:06:59 +03:00
Bruce Weirdan
5dfd157d72
Merge pull request #6420 from orklah/ternary-override-type
Ternary override type when reassigning
2021-09-04 21:58:32 +03:00
Bruce Weirdan
b710aab148
Merge pull request #6419 from TysonAndre/in_array-fix 2021-09-04 21:56:36 +03:00
Bruce Weirdan
3a3fde332e
Merge pull request #6392 from orklah/control-action-test 2021-09-04 21:38:08 +03:00
orklah
e2b594820e fix test 2021-09-04 20:27:25 +02:00
orklah
0825f220fe allow ternary to override previous type when reassigning 2021-09-04 20:22:06 +02:00
Tyson Andre
58e7ae1809 Also support non-literal types in strict in_array() check
Modified approach to #6396 by orklah

Fixes #6333

Co-Authored-By: orklah <ronan_morin@hotmail.com>
2021-09-04 12:34:49 -04:00
orklah
ea50e5db4d add test 2021-09-04 14:19:49 +02:00
orklah
861d2187dd fix tests 2021-09-04 14:17:55 +02:00
orklah
de27693015 change test to show while loop with truthy value is still inferred 2021-09-04 14:10:12 +02:00
orklah
e99c1951ae Make Psalm understand infinite while loop in control actions 2021-09-02 22:28:01 +02:00
Bruce Weirdan
a655ca81c1
Merge pull request #6391 from ro0NL/6388 2021-09-02 23:23:32 +03:00
Roland Franssen :)
9a6ae5a27a test 2021-09-02 20:53:23 +02:00
orklah
58e578e6a7 fix Generator giving templates to Iterator 2021-09-02 20:12:32 +02:00
Bruce Weirdan
eb973ab2e1
Merge pull request #6335 from boesing/bugfix/recursive-class-aliases 2021-08-31 23:51:19 +03:00
Bruce Weirdan
b713140cc1
Merge pull request #6326 from piporoid/issue/2164
Prevent @property annotations on class properties
2021-08-31 23:46:56 +03:00
Bruce Weirdan
cbcc38aab8
Merge pull request #6339 from niconoe-/allow-object-on-array_walk 2021-08-31 23:45:10 +03:00
Bruce Weirdan
103b2b7244
Warn about array_walk_recursive over objects 2021-08-31 23:18:20 +03:00
Bruce Weirdan
624246b996
Merge pull request #6376 from orklah/use-variable-in-backtick 2021-08-29 04:39:13 +03:00
orklah
10c20dc8f3 mark variable used in backticks as used 2021-08-29 00:26:52 +02:00
Bruce Weirdan
b370ce92aa
Report RawObjectIteration when array_walk is used on objects 2021-08-20 01:43:49 +03:00
Bruce Weirdan
9222b24ea1
Merge pull request #6321 from orklah/analyze-dynamic-classConstFetch 2021-08-20 01:06:56 +03:00
orklah
dbf3512b70 introduce $definite_class flag and use it to avoid using final keyword for simple inference 2021-08-19 23:19:59 +02:00
Bruce Weirdan
3cb28e6399
Merge pull request #6344 from orklah/vendor-suppressions
don't report UnusedSuppressions in non project dirs
2021-08-19 20:53:21 +03:00
orklah
6cf7660ad8 fix CS 2021-08-19 19:34:30 +02:00
orklah
7fd0d5f28e create real path for Psalm to stop ignoring suppressions 2021-08-19 19:31:58 +02:00
Maximilian Bösing
d4559f5ba3
qa: add failing test regarding recursive alias resolving
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2021-08-18 16:18:44 +02:00
Benjamin Morel
621c4dd8d1 Enforce class-string in is_subclass_of() 2021-08-17 23:14:11 +02:00
Bruce Weirdan
e5b797c764
Merge pull request #6327 from boesing/bugfix/class-alias 2021-08-17 23:35:25 +03:00
Maximilian Bösing
990723ce64
qa: rework unit test to use already available project_initializer
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2021-08-17 21:46:00 +02:00
Barney Laurance
88276d7f1e Fix error message for call to internal method from root namespace 2021-08-17 18:54:57 +01:00
orklah
1bf7447685 small refactor, add LiteralClassString, remove alter code blocks 2021-08-17 18:51:59 +02:00
Maximilian Bösing
7ab5d29e08
qa: add unit test to verify aliased interface is properly detected
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2021-08-17 18:40:18 +02:00
piporoid
1df5f3012a Prevent @property annotations on class properties 2021-08-17 23:40:26 +09:00
orklah
9264ea5cbb Allow type inference on dynamic ClassConstFetch 2021-08-16 21:20:20 +02:00
Bruce Weirdan
a9ead63ae1
Revert "Assertions for Integer Range" 2021-08-14 18:06:41 +03:00
Bruce Weirdan
7ff2a660dd
Merge pull request #6233 from supersmile2009/fix-in-array-assert 2021-08-13 01:39:31 +03:00
Bruce Weirdan
a4b6fbcbdf
Simplified InArrayTest a bit 2021-08-13 01:27:28 +03:00
Bruce Weirdan
6294e06955
Improve constant array inference
This fixes int offset inference and adds handling for array unpacks in
constant arrays. Mostly it's copy/pasted from `ArrayAnalyzer` with
further adjustments.

Fixes vimeo/psalm#6263
Fixes vimeo/psalm#6289
2021-08-12 20:39:21 +03:00
Bruce Weirdan
868a1672c1
Merge pull request #6253 from orklah/unusedSuppress 2021-08-09 23:34:14 +03:00
Bruce Weirdan
94f034b7ad
Merge pull request #6272 from orklah/sealed-array-combination 2021-08-09 23:33:00 +03:00
orklah
9ca771286f fix test 2021-08-09 21:18:19 +02:00
orklah
e688781383 seal the result of two sealed KeyedArrays 2021-08-09 20:43:17 +02:00