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

188 Commits

Author SHA1 Message Date
orklah
3e6bf6f35f remove unused nullable on param types 2021-09-25 16:05:47 +02:00
orklah
fcbd443bc8 initialize array 2021-07-17 22:04:22 +02:00
orklah
79d0647d19 fix issue when setting a value to a global is considered unused 2021-07-17 22:00:54 +02: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
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
Bruce Weirdan
6abce3525a
Enforce use sort (#5900) 2021-06-07 22:55:21 -04:00
Matt Brown
4f9067f5c8 Fix unused properties in Psalm’s own codebase 2021-05-21 09:15:23 -04:00
Bruce Weirdan
d57dde0d15
Allow phantom classes in instanceof expression (#5498)
Fixes vimeo/psalm#5481
2021-03-29 00:11:45 -04:00
Matt Brown
96e0743892 Fix #5325 – remove all memoised methods when calling a method with property mutations 2021-03-05 00:39:25 -05:00
Matt Brown
924f6b6f94 Propagate mutation removal up the context parent tree
Fixes #5231
2021-02-25 18:11:58 -05:00
Matt Brown
2f58c6afc8 Fix #5020 - remove previous catch var assertions when assigning inside catch 2021-01-17 14:28:28 -05:00
Matt Brown
d10a06837d Fix #5001 - update variables after context after type change from empty
Empty is the invalid state, and some old logic here was causing a bug
2021-01-13 11:35:52 -05: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
524084a64c Tighten up rules arouund when mutation-free methods get memoised 2020-12-08 16:39:06 -05:00
Matt Brown
dff2943096 Fix #4794 - invvalidate dependent types when their variables change 2020-12-06 18:16:22 -05:00
Matt Brown
9daa534656 Ensure we flush out re-assigned vars also referenced
Fixes #4488
2020-11-06 12:51:41 -05:00
Matt Brown
024d93b7fd Fix #4467 - variables are only the same if they were set in the same location 2020-11-01 11:26:42 -05:00
orklah
ceaaa39ec3
improve phpdoc (#4352) 2020-10-17 12:36:44 -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
Matt Brown
14efde286f 4.x - refactor unused variable detection
This turns unused variable detection into an explicit control-flow problem, where before we had a more simplistic mark-and-sweep algorithm
2020-09-30 12:28:13 -04:00
orklah
37a2f8a33d
unused use statements (#4228) 2020-09-22 01:10:46 -04:00
Brown
3e0f449163 Detect more issues inside finally block 2020-09-21 15:16:19 -04:00
orklah
ead107fa9e
More return types (#4173)
* add native return types

* redundant phpdoc
2020-09-12 11:24:05 -04:00
orklah
8c7423505a
add native param types (#4137)
* add native param types

* redundant phpdoc

* add more param types and adds "?" to nullable types

* remove redundant phpdoc

* add more param types and remove redundant phpdoc

* add more param types and remove redundant phpdoc
2020-09-06 19:36:47 -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
988e17f11d Make clause fully immutable 2020-08-26 15:35:29 -04:00
Brown
8ad1c2eeb1 Use immutable data structures for clause calculations 2020-08-26 10:41:47 -04:00
Brown
b168777236 Fix #3924 - remove descendants after reconciled change 2020-08-03 02:06:42 -04:00
kazusuke sasezaki
94002367ba
fixed typo (#3883) 2020-07-24 09:34:05 -04:00
Matthew Brown
1b752d06ab Fix #3201 - add additional constraints on constructor initialisation 2020-04-21 00:04:47 -04:00
Matthew Brown
47c1470e3b Refactor reference checks to use more appropriate properties 2020-03-28 16:30:56 -04:00
Brown
971ae50bea Do prep work for #3024 - improve handling of absent class references 2020-03-26 12:35:27 -04:00
Matthew Brown
6c7f89b0ab Fix #2920 - track unevaluated code after nested returns 2020-03-15 14:31:41 -04:00
Matthew Brown
4707b21227 Fix tests 2020-02-21 22:15:25 -05:00
Brown
15808458cc Better understand nesting loops and switches
Fixes #2700
2020-01-27 12:17:12 -05:00
Brown
e68ca6a20b Fix #2661 - catch invalid array_push on property 2020-01-22 09:57:59 -05:00
Matthew Brown
1b7b71f2ca Fix #2591 - always remove changed var from parent clauses
Even when there are no child clauses due to an assertion
2020-01-10 23:46:45 -05:00
Matthew Brown
9fa2db1b6c Move Union::getTypes to Union::getAtomicTypes 2020-01-04 12:20:26 -05:00
Matthew Brown
55c2f7faa2 Fix #2508 - don’t replace templated types with generic ones inside own function 2019-12-28 18:38:02 -05:00
Brown
2469f04715 Improve reconciliation of arrays with constant offsets 2019-12-13 17:17:14 -05:00
Matthew Brown
83b10bb9af Fix #2426, or at least some of it 2019-12-08 00:49:34 -05:00
Matthew Brown
df395944f8 Change how $changed_var_ids is communicated 2019-12-07 01:23:35 -05:00
Brown
353cf2351e Fix #2259 - if error suppression is use, list destructuring values will be nullable 2019-10-22 10:40:37 -04:00
Brown
16c33d1565 Add support for list type
Fixes #2209
2019-10-08 18:44:46 -04:00
bugreportuser
064d4886c3 Track exception suppressions (#2211) 2019-10-04 14:01:58 -04:00
Brown
ebe8bedb20 Allow assertions on class constants 2019-10-03 18:13:04 -04:00
Brown
b7b4baff8f Add support for @immutable
Fixes #1272
2019-08-30 12:36:35 -04:00
Brown
236a7ffd15 Fix #2027 - fix improperly retained callable check 2019-08-16 10:32:03 -04:00