orklah
5a2df475ca
changes after review
2021-09-19 19:30:03 +02:00
orklah
3d7dc740c2
fix UnaryMinus
2021-09-19 19:30:03 +02:00
orklah
a6630c49a2
fix mod calculation with ranges
2021-09-19 19:30:02 +02:00
orklah
c226285a4b
fix Mul and Pow operations
2021-09-19 19:30:02 +02:00
orklah
a8a659895f
add failing test
2021-09-19 19:30:02 +02:00
orklah
f789ab0655
add test and allow checking in already inferred types instead of just relying on statements from PHPParser for assertions
2021-09-19 19:30:02 +02:00
orklah
ae0586b0e6
fix shift inference
2021-09-19 19:30:02 +02:00
orklah
e0e34bec33
allow intersections and add test
2021-09-19 19:30:02 +02:00
orklah
c26f403e7e
fix an old bug with inverting positive int + allow inverting TIntRange
2021-09-19 19:30:02 +02:00
orklah
488c13b7c5
handle bit operations and add test
2021-09-19 19:30:02 +02:00
orklah
6f050359ce
refactor int vs int range arithmetic by converting everything to range and add tests
2021-09-19 19:30:02 +02:00
orklah
d2f73d3adb
fix and test minus case
2021-09-19 19:30:01 +02:00
orklah
b5b2677ee3
allow negating inferiorto/superiorto
2021-09-19 19:30:01 +02:00
orklah
b3a62c76dd
add tests and use getNewHighestBound at one place
2021-09-19 19:30:01 +02:00
orklah
edff17134d
improve test
2021-09-19 19:30:00 +02:00
orklah
7d6ede61fd
fix test
2021-09-19 19:30:00 +02:00
orklah
ee75586fbf
expand test and fix assertions
2021-09-19 19:30:00 +02:00
orklah
d2e1388473
Allow inferior-to and superior-to even with negated numbers
2021-09-19 19:30:00 +02:00
orklah
d9d9fa67a6
remove faulty test
2021-09-19 19:29:59 +02:00
orklah
3a8afe07be
fix test
2021-09-19 19:29:59 +02:00
orklah
1dcdaea117
int range arithmetics
2021-09-19 19:29:59 +02:00
orklah
e9f3d5ba06
assert from TClassString
2021-09-17 20:05:25 +02:00
Aleksandr Zhuravlev
65407cc10d
Got rid of test
2021-09-16 23:07:32 +12:00
whsv26
8b54cca3a8
Fix different context templates invalid argument bug for trait.
2021-09-13 23:43:09 +03:00
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
Tyson Andre
f4f989d1e5
Use different in-array-*
check for non-literals
...
Negating this would not contradict the original condition if the
variables were different. A string can be in one array of strings but
not be in a different array of strings.
2021-09-06 21:48:08 -04:00
Tyson Andre
f69a255611
Fix false positive ParadoxicalCondition in negation of in_array
...
For #6439
2021-09-06 21:15:04 -04: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
Bruce Weirdan
8c531fec4b
Tweaks
...
Changed the format of the historical callmap to be plain signature list,
as it isn't really a delta file and renamed the file to not be confused
with deltas.
Added a test to ensure entries in main callmap have history.
2021-08-08 18:43:42 +03:00
bjscharp
07d48d779a
Merge branch 'master' into callmap-delta-inconsistencies
2021-08-08 10:41:42 +02:00
bjscharp
96056d329f
Add simple test to verify outout of getCallMap method
...
Convert deltafile format to new style proposed by weirdan
Modify CallMapTest to use new format
Modify InternalCallMapHandler to use new format
Move assertions to base testcase
2021-08-08 10:39:54 +02:00
orklah
570aa1bb8e
fix test?
2021-08-07 10:18:06 +02:00
orklah
b194291bb3
try to fix offsets
2021-08-07 00:08:19 +02:00
Maximilian Bösing
9d59fbe6bb
feature: introduce literal float methods to Union
type
...
- Added `Psalm\Type\Union#isSingleFloatLiteral`
- Added `Psalm\Type\Union#getSingleFloatLiteral`
- Added `Psalm\Type\Union#hasLiteralFloat`
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
2021-08-06 21:05:26 +02:00
bjscharp
d1d9e3763c
Removed unused test dependencies
2021-08-06 07:45:17 +02:00
bjscharp
a01b92de8a
Split duplicate add/remove check off into seperate tests to deal with several extra error paths
2021-08-06 07:33:37 +02:00
bjscharp
f39c462138
Add missing bcadd function to 8.0 delta file.
...
To prevent similar errors, add baseline file with signatures pre-7.1, to help verify delta files are correct.
Modify test to use this to detect missing 'old' entries
2021-08-05 23:21:41 +02:00
orklah
10049450f8
fix tests for the last time............................................... maybe?
2021-08-05 21:48:37 +02:00
orklah
ba2f623754
fix unused variables
2021-08-05 21:32:32 +02:00
orklah
50fd9065de
fix tests
2021-08-05 21:15:04 +02:00
orklah
3fe678b914
ignore UnnecessaryVarAnnotation
2021-08-05 21:05:44 +02:00
bjscharp
ac5ea252ff
Added test to detect problems and inconsistencies in CallMap files
...
- Fixed inconsistencies in callmap delta files (mainly 8.0)
- Added several missing changes in the bc_* functions
- Added several missing changes in the mb_* functions
- Added several missing changes in the xml_parser_* functions
- Fixed several issues with sodium_ functions
- Removed all but one of the date_* functions. All were marked as having lost the option to return false, despite this only being true for date_format
2021-08-05 19:07:31 +02:00
Alexandr Zolotukhin
3d61f6ca65
Add more tests
2021-08-05 16:42:52 +03:00
Alexandr Zolotukhin
c51f0f4fbf
Add tests with needle/haystack value of union types which intersect partially
2021-08-03 21:09:59 +03:00
Alexandr Zolotukhin
586e8a157e
Fix tests with loose types. Fix return type in the reconciler.
2021-08-03 19:34:35 +03:00
Alexandr Zolotukhin
e278b4fd93
Add failing test cases
2021-08-03 17:29:28 +03:00
Bruce Weirdan
caaff6e3b4
Merge pull request #6210 from orklah/int-range3
2021-08-01 16:37:15 +03:00
Bruce Weirdan
3a1714e732
Merge pull request #6215 from weirdan/fix-6211
...
Use fully-qualified name for virtual class strings
2021-08-01 16:36:25 +03:00
Matthew Brown
a205a23ccb
Fix #6212 - remove untested code, add test for reasonable behaviour
2021-07-31 19:50:56 -04:00
Bruce Weirdan
e4ead74879
Use fully-qualified name for virtual class strings
...
Fixes vimeo/psalm#6211
2021-08-01 02:22:16 +03:00
orklah
d4bf17f323
fix test
2021-07-31 15:47:12 +02:00
orklah
128a811174
add internal assertions for superior and inferior
2021-07-31 15:47:12 +02:00