Grégoire Paris
26f8e5b333
Add negated identity with false case
...
This is the opposite of === true and works the same.
2021-07-17 03:20:23 +03:00
Bruce Weirdan
af5cdb4dd4
Check deprecated properties on $this->prop reads
...
Fixes vimeo/psalm#6118
2021-07-17 01:20:35 +03:00
orklah
0bd8b03f7a
Fix usage of gettype in a switch with closed resource
2021-07-14 12:49:46 +02:00
Bruce Weirdan
601c8cac5b
Merge pull request #6086 from orklah/cleanup
2021-07-14 09:08:18 +03:00
orklah
c3a4e513f9
add more detailed phpdoc for $conditional and remove unused code
2021-07-14 00:02:36 +02:00
orklah
bcd22335b6
add some detailed phpdoc for $conditional
2021-07-13 22:35:57 +02:00
orklah
874b8ed7ae
fix doc
2021-07-13 22:29:27 +02:00
orklah
647b9b78dc
cleanup and refactor AssertionFinder
2021-07-13 20:54:47 +02:00
Ruslan Karimov
8a08489dcc
Merge branch 'master' into fix-5957
...
# Conflicts:
# tests/UnusedVariableTest.php
2021-07-13 10:15:35 +05:00
Ruslan Karimov
cfaca07c6d
added dataflow to stringy bitwise op, bitwise not op (fix 5957)
2021-07-13 10:05:21 +05:00
Bruce Weirdan
6729f4db01
Merge pull request #6083 from orklah/falsable-argument
2021-07-13 02:13:39 +03:00
orklah
52033f4b69
fix condition when scalar is allowed
2021-07-13 00:34:22 +02:00
orklah
1fc8982ca9
fix condition when bool is allowed
2021-07-13 00:19:13 +02:00
orklah
688367de38
Always emit InvalidArgument when the parameter is always false and not accepted
2021-07-13 00:06:36 +02:00
Matthew Brown
f2bc6913db
Fix #6061 — delay analysis of array value except when unpacking ( #6081 )
2021-07-12 17:05:33 -04:00
Bruce Weirdan
e93b37a225
Merge pull request #6060 from VincentLanglet/statement
2021-07-11 22:12:10 +03:00
Matthew Brown
acc7ee261c
Fix #6066 - introduce more robust system for capturing template constraints ( #6072 )
...
* Fix #6066 - add better system for capturing template constraints
* Fix comment
2021-07-11 12:03:21 -04:00
Vincent Langlet
3339ce1379
Use stmt instead of args
2021-07-11 11:22:13 +02:00
Matthew Brown
d883d73991
Fix template bound terminology
...
I had this flipped by mistake
2021-07-10 14:08:09 -04:00
Vincent Langlet
49ed7b045f
Pass statement to MethodReturnTypeProviderEvent
2021-07-08 00:02:36 +02:00
orklah
f8644fb508
Improve resolution of __METHOD__ and __FUNCTION__
2021-07-03 10:01:53 +02:00
Matt Brown
d18a4f4ccc
Don’t stop scanning loop contents due to possibly-null iterator
2021-06-28 13:13:12 -04:00
Matt Brown
19cc4cb4ee
Simplify lots of usage checks
2021-06-25 10:14:49 -04:00
Matt Brown
67d68a5dc0
Use more accurate variable name
2021-06-25 09:54:39 -04:00
Bruce Weirdan
6d4262edbd
Mark return values in as throw
argument as used ( #5989 )
...
Fixes vimeo/psalm#5975
2021-06-25 09:11:27 -04:00
Oliver Hader
38d3b15f8d
[BUGFIX] Specialize TaintSink in IncludeAnalyzer ( #5986 )
...
* [TEST] Assert more details in TaintTest
* [TEST] Add test for multiple tainted includes
* [BUGFIX] Specialize TaintSink in IncludeAnalyzer
Fixes : #5986
2021-06-23 08:27:03 -04:00
Bruce Weirdan
0a57c86549
Announce removal of deprecated methods ( #5956 )
...
Refs vimeo/psalm#4700
2021-06-20 14:12:20 -04:00
orklah
3c9476bdf6
Prevent infinite loop in case a TClassConstant is expanded to itself ( #5951 )
2021-06-18 08:51:19 -04:00
orklah
79478a60b1
Allow class constant as offset key ( #5943 )
...
* allow class-constant as an array offset when the type match
* remove object with __toString as a possible offset as it's not valid
2021-06-17 18:15:57 -04:00
orklah
872f1c232c
allow Psalter to fix RedundantCast ( #5948 )
...
* allow Psalter to fix RedundantCast
* fix test
2021-06-17 18:15:45 -04:00
Matthew Brown
c2f7422e80
Prevent crash with non-UTF-8 string
...
Fixes #5945
2021-06-17 12:26:18 -04:00
Bruce Weirdan
e552925af6
Emit separate type of issue when foreach value is unused ( #5932 )
...
* Emit separate type of issue when foreach value is unused
Fixes vimeo/psalm#5929
* Fixed var name case sensitivity
2021-06-17 00:40:24 -04:00
Matt Brown
9dde8eed9d
Add support for literal-int annotations as well
2021-06-14 23:24:09 -04:00
Matt Brown
c3fdfc5795
Support literal ints in encapsed strings
2021-06-14 16:30:45 -04:00
Matt Brown
4941b9e5d2
Rename class and make it type-hintable
2021-06-14 16:02:59 -04:00
Matt Brown
5ae8b2a23f
Add preliminary support for literal-string
2021-06-14 15:30:25 -04:00
Bruce Weirdan
24d45a50de
Merge pull request #5924 from BafS/fix-type-error-patch-1
2021-06-13 21:19:43 +03:00
BafS
d395e00f18
Add assertion
2021-06-13 12:07:34 +02:00
Matt Brown
23b7ff86b7
Mark interface methods as unused even when inherited
2021-06-12 16:13:29 -04:00
BafS
eb4ecc20d4
Fix style
2021-06-11 20:11:21 +02:00
BafS
07cf6012f7
Use assert() instead of phpdoc
2021-06-11 20:07:59 +02:00
BafS
dde0f1fb06
Fix Uncaught TypeError with some shifts
2021-06-11 20:03:23 +02:00
Matt Brown
f2f5f1eaa2
Revert fix and tests
2021-06-10 17:44:34 -04:00
Matt Brown
47bf5ed567
Fix #5918 - add new issue to detect unquoted strings
2021-06-10 17:43:04 -04:00
Matt Brown
e661c5fb55
Fix erroneous use when comparing methods
2021-06-10 14:39:01 -04:00
Matthew Brown
6d09418a23
Detect unused return values ( #5917 )
...
* Detect unused return values
* Allow static-returning instance methods (presumed to be fluent)
* Make $is_used the default for Codebase::methodExists
2021-06-10 14:18:15 -04:00
Matt Brown
8509999f3f
Remove some unused return values
2021-06-10 12:09:46 -04:00
Matthew Brown
d12cf88e83
Add back supported for templated index assignment
2021-06-09 12:55:37 -04:00
Matthew Brown
0a7d254689
Fix #5911 - improve non-terminating switch type inference
2021-06-09 09:06:23 -04:00
Bruce Weirdan
6abce3525a
Enforce use
sort ( #5900 )
2021-06-07 22:55:21 -04:00