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

40 Commits

Author SHA1 Message Date
orklah
bee5b69f7f use Attribute feature of PHP-Parser to avoid dealing with dynamic properties 2021-10-13 13:27:56 +02:00
orklah
d5eb471688 every condition must be true 2021-10-10 10:27:22 +02:00
orklah
85668ed255 Add support for infinite for loops 2021-10-10 10:22:41 +02:00
orklah
97e91e6bf0 code trimming 2021-09-25 02:34:21 +02:00
orklah
f9b37cea5b name error 2021-09-04 14:08:04 +02:00
orklah
c8cf503367 introduce isAlwaysFalsy and isAlwaysTruthy 2021-09-04 13:56:13 +02:00
orklah
e99c1951ae Make Psalm understand infinite while loop in control actions 2021-09-02 22:28:01 +02:00
orklah
9ff0fceb71 CS changes 2021-07-20 23:41:11 +02:00
orklah
acfdb82856 Basic implementation 2021-07-20 23:34:38 +02: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
Matt Brown
3c43bc1522 Fix #5789 - prevent incorrect return type inference when all cases return 2021-05-18 08:52:41 -04:00
Matt Brown
9eda9f9bbf Fix cs 2021-05-17 19:44:55 -04:00
Matt Brown
21456f51e6 Only call ScopeAnalyzer once on whole function body 2021-05-17 18:52:25 -04:00
Matt Brown
836587ec1d Fix combination of end states with never 2021-05-17 12:35:27 -05:00
Matt Brown
9635ca620c Correctly interpret continue 2 in nested loops 2021-05-17 08:26:38 -05:00
Matt Brown
f6bdeb6234 Fix switch-with-continue bug 2021-05-17 07:27:58 -05:00
Bruce Weirdan
9e19653a72
Infer never return type (#5710)
* Allow __toString to return never

Fixes vimeo/psalm#5653

* Push $return_is_exit down

* Produce unique control actions

* Test suggesting `@return never`
2021-05-05 01:22:29 -04:00
orklah
09fb141e49
Document lowercase-string when possible (#4904)
* document lowercase-string

* fix missing strtolower
2020-12-29 11:42:12 +00:00
Matt Brown
ff3fff56d4 Simplify assertion negations, centralising as much as possible
Now the flag passed to scrapeAssertions just determines the errors emitted
2020-11-19 14:32:49 -05:00
Matt Brown
8d2e88ef41 Fix #4333 - don’t get tripped up on try with no catches 2020-10-15 10:15:55 -04:00
Matt Brown
d8d17a6587 Fix #4327 - make sure loop always returns 2020-10-14 20:19:55 -04:00
orklah
62e79fb7ea
param types (#4313) 2020-10-12 15:46:47 -04:00
orklah
10f2966dcb
return types (#4311)
* return types

* remove willReturn for void methods
2020-10-12 15:02:52 -04:00
Brown
c17bacd682 Prevent duplicate switch return types 2020-09-25 09:45:20 -04:00
Brown
3e0f449163 Detect more issues inside finally block 2020-09-21 15:16:19 -04:00
Brown
7bd1c43be1 Don’t forget control actions 2020-09-21 11:18:30 -04:00
orklah
1a1b88bb5e
add visibilities to constants (#4219) 2020-09-20 12:54:46 -04:00
orklah
f66d57f19d
add native return types (#4116)
* add native return types

* remove redundant phpdoc
2020-09-04 16:26:33 -04:00
Brown
f0a5bd74b6 Detect never-return statement same as a throw 2020-05-26 15:02:23 -04:00
Matthew Brown
5f7730c12e
Add slash 2020-01-27 12:26:06 -05:00
Brown
15808458cc Better understand nesting loops and switches
Fixes #2700
2020-01-27 12:17:12 -05:00
Brown
0bcb7863f3 Use better system for storing inferred types and assertions 2019-11-25 11:44:54 -05:00
Matthew Brown
0f7925e769 Fix #2183 - evaluate return after do with break inside 2019-09-29 16:12:52 -04:00
LeSuisse
f29826b958 Fully qualify constants and function calls (#1849)
This should give a small performance boost.
Part of #1837.

The change is enforced via phpcs and can be autofixed
with phpcbf.
2019-06-26 16:52:29 -04:00
Matthew Brown
cacced782d Fix #1592 - allow methods with a simple exit to have the same treatment as those with a simple throw 2019-05-01 23:45:03 -04:00
Brown
53749bd5c5 Do better at finding things that exit 2019-01-02 18:14:47 -05:00
Brown
cca0070d38 Allow function calls that exit to act themselves like exit 2019-01-02 17:16:04 -05:00
Matthew Brown
b32000fa05 Fix #689 - add checks for @internal annotations 2018-12-01 18:37:49 -05:00
Matthew Brown
4688b25fd9 Move internal classes to own namespace 2018-11-12 11:20:59 -05:00