Matthew Brown
cb243778d2
Fix #3917 - allow comparisons between classes and interfaces
2020-08-16 16:25:59 -04:00
Tom Klingenberg
04b6dfdc5b
Fix PSR-4 deprecation notices on composer install ( #3959 )
...
Previously when checking out the repository and installing the source
package via `$ composer install` composer did spill deprecation notices for
four files not complying with the PSR-4 auto-loading standard.
This is a minor issue, composer install works and can be addressed by
fixing name-spaces (all of those three are in tests).
For the one function test, fixing the directory structure / dirname of the
(single) affected function test (fourth file).
2020-08-07 23:22:30 -04:00
Brown
c0b0036109
Fix #3934 - prevent unsafe use of new static
2020-08-05 19:39:27 -04:00
Brown
e0f5595307
Fix #3932 - try to get assertions of negated expression if instant negation fails
2020-08-05 16:53:30 -04:00
Brown
fd4ced42a7
Don’t register new assignment inside isset expr
2020-07-31 12:44:01 -04:00
Brown
57cd21346c
Fix #3914 - treat $i++ like $i = $i + 1
2020-07-31 11:26:54 -04:00
Brown
a8c0d81dc1
Prevent bool > 1 in strict mode
2020-07-30 11:25:47 -04:00
Brown
74eea18563
Add better checks
2020-07-26 19:09:26 -04:00
Brown
d9d5fdd6c9
Add more rules around positive ints
2020-07-26 18:29:17 -04:00
Matthew Brown
1d077cc48e
Fix #3894 - don’t alter class-string during erroneous emptiness check
2020-07-25 22:49:19 -04:00
Brown
7ef3d4711f
Fix some more tests
2020-07-21 23:16:56 -04:00
Brown
76bd5b6278
Refactor type comparison
2020-07-21 19:40:35 -04:00
ygottschalk
de2109234d
fixes wrong return type of key() #3838 ( #3839 )
...
* fixes wrong return type of key() #3838
fixed/added tests for key
* fixed test again
2020-07-20 04:49:36 -04:00
Brown
06ee1b71c7
Improve check for empty array
2020-07-15 09:49:30 -04:00
Brown
0ab163fd78
Skip dodgy tests
2020-07-15 01:53:31 -04:00
Brown
f0a5463834
Catch string subtypes that cannot be identical
2020-07-14 10:08:31 -04:00
Brown
68fe66fcf6
Fix tests
2020-06-25 01:33:02 -04:00
Brown
7a7cd91c24
Fix #3631 - better treatment for assignments in complex conditionals
2020-06-24 13:16:52 -04:00
Brown
4d6fc4d0ca
Fix get_class($foo) === static::class checks
2020-06-23 13:11:19 -04:00
Brown
1f86afece7
Revert "Fix #3631 - apply assertions to RHS of equality in conditional"
...
This reverts commit 9c17795545
.
2020-06-22 20:01:27 -04:00
Brown
9c17795545
Fix #3631 - apply assertions to RHS of equality in conditional
2020-06-22 15:16:16 -04:00
Brown
9ca6c868b7
Fix #3563 - add workaround for == true
2020-06-12 10:58:44 -04:00
Matthew Brown
806db80d63
Fix #3440 - literal string doesn’t contain numeric-string
2020-05-24 22:42:08 -04:00
SignpostMarv
911ac2d363
Infer numeric-string from (string)$numeric ( #3390 )
...
* adding test for vimeo/psalm#3370
* check if typecast will result in numeric-string
* int & float as per examples in vimeo/psalm#3370
* numeric & numeric-string because they shouldn't lose numericness.
* satisfy phpcs
* adjusting assertions to reflect typecasting change
2020-05-18 13:42:47 -04:00
Brown
21798efed2
Fix #3388 - eliminate null after < 0 check
2020-05-18 08:52:44 -04:00
Brown
ae48c1895f
Fix #3365 - add support for negated empty string checks
2020-05-14 22:09:37 -04:00
Brown
2d5c2a9dd1
Fix #3324 - prevent crash asserting on possibly-undefined variable
2020-05-08 14:21:10 -04:00
Pierre Grimaud
e7990390a6
Fix typos ( #3255 )
2020-04-28 09:17:31 -04:00
Brown
a25610cefd
Fix #3133 - prevent crash when analysing isset
2020-04-13 08:34:38 -04:00
Brown
73f8f963fa
Expand out class constants as early as possible
...
Fixes #3128
2020-04-12 20:38:36 -04:00
Brown
9d2957d339
Fix a few more edge-cases
2020-04-12 01:26:11 -04:00
Brown
7dfa37beb2
Improve ergonomics of array assignment
2020-04-11 17:50:24 -04:00
Brown
db7447abd7
Make array coercion-to--mixed rules a little more lenient
2020-04-10 16:21:48 -04:00
Brown
3a4dd70403
Prevent MixedMethodCall from generated array offsetGet calls
2020-04-09 11:45:15 -04:00
Brown
bd2104c5ba
Merge with mixed in nested arrays
2020-04-09 09:27:21 -04:00
Brown
550ba0a4c9
Compare to real outer context, not if one
...
Fixes #3091
2020-04-07 15:13:17 -04:00
Brown
61c979136f
Fix #3091 - simplify elseif negated clauses where possible
2020-04-07 13:04:24 -04:00
Brown
ddc8c50d2a
Prevent some inheritance issues
2020-03-31 11:28:36 -04:00
Matthew Brown
1b88316c51
Convert method from recursive to inline
2020-03-29 19:42:22 -04:00
Matthew Brown
15c6778223
Add test that passes
2020-03-29 18:59:48 -04:00
Matthew Brown
32d5c92428
Split up test
2020-03-29 18:28:49 -04:00
Matthew Brown
f94ab22a5f
Be better about strict inference
2020-03-25 09:18:49 -04:00
Brown
25bd2ed5fb
Fix #3010 - prevent false-negative after calling isset on possibly-false array
2020-03-24 12:01:39 -04:00
Matthew Brown
6746f1c047
Fix #3004 - reset property types inside a closure defined in a class
2020-03-21 20:46:38 -04:00
Matthew Brown
c85fa9083d
Fix #2915 - prevent "if (true)" and similar
2020-03-15 22:23:31 -04:00
RJ Garcia
5a008fe1e6
Tests for TypeAnalyzer::isContainedBy on classes ( #2971 )
...
- Added additional tests to showcase subtyping
Signed-off-by: RJ Garcia <rj@bighead.net>
2020-03-14 14:48:45 -04:00
Matthew Brown
c5fa07920c
Fix improper property var calculation
...
Ref #1332
2020-03-11 11:03:27 -04:00
Brown
3c416482ec
Fix #2932 - don’t crash when trying to expand callable object-like array
2020-03-09 10:56:37 -04:00
Brown
ea0a670230
Flesh out class constants in function call return type
...
Fixes #2884
2020-02-26 17:28:44 -05:00
Matthew Brown
97a849b1be
Fix #1311 - narrow scalar properly, exploding constituent types
2020-02-22 20:25:13 -05:00