Matt Brown
78cc1786c8
Don’t check newly-scoped vars in conditional
2018-02-08 14:46:06 -05:00
Matt Brown
7f4be858c2
Fix #498 - add better issue type for docblock contradiction
2018-02-07 15:20:47 -05:00
Matthew Brown
fb300baa6d
Move a bunch of code into Codebase
2018-02-01 00:50:01 -05:00
Matthew Brown
44b8b22995
Improve checks for unused variables and params
2018-01-28 17:28:34 -05:00
Matthew Brown
ea28ee709d
Improve unused variable detection slightly
2018-01-25 01:04:26 -05:00
Matthew Brown
e8487e86f0
Make sure else/elseif roots are at the if declaration
2018-01-21 22:05:57 -05:00
Matthew Brown
68b00ea49a
Add automatic fix for PossiblyUndefinedVariable
2018-01-21 16:24:20 -05:00
Matthew Brown
799aef628e
Fix type assignment checks
2018-01-20 11:48:16 -05:00
Scott
2bab66855b
Specify delimiter in preg_quote
...
```
PHP Warning: preg_match(): Unknown modifier 't' in /home/scott/project-redacted/vendor/vimeo/psalm/src/Psalm/Checker/Statements/Block/IfChecker.php on line 166
```
2018-01-17 18:15:13 -05:00
Matt Brown
a253ca68bc
Allow array_filter to inspect closure bodies
2018-01-17 16:07:46 -05:00
Matthew Brown
fb9f20f4b8
Find unused properties with dead code checks
...
Fixes #424
2018-01-10 23:29:18 -05:00
Matthew Brown
c28b804633
Fix potential filtering of non-zero keys
2018-01-08 01:38:25 -05:00
Matthew Brown
8ababf1537
Allow assertions on mixed vars
2018-01-08 00:14:02 -05:00
Matthew Brown
bb41b92789
Filter forumulae to remove assertions on unknowable things
2018-01-07 23:59:25 -05:00
Matthew Brown
8a8253ac4c
Fix indentation
2018-01-02 21:23:48 -05:00
Matt Brown
13931766ce
Add PHP 7.2-compatibility for Psalm development
2018-01-02 19:55:07 -05:00
Matthew Brown
c38cf9b672
Migrate type reconciliation code to its own class
2017-12-29 10:55:53 -05:00
Matthew Brown
2011b8fb8f
Remove dead code
2017-12-16 10:51:04 -05:00
Matthew Brown
a413e0496a
Fix #361 by terminating analysis if loop statements have issues
2017-12-10 16:22:45 -05:00
Matt Brown
e2b1b24dbf
Fix empty checks, make them more like isset checks
...
Fixes #372
2017-12-05 12:14:10 -05:00
Matthew Brown
7d003c5bc1
Fix erroneous treatment of or clauses in if statements
2017-12-03 16:25:52 -05:00
Matthew Brown
d20b8d3034
Improve loop analysis ( #365 )
2017-12-02 18:28:18 -05:00
Matthew Brown
cfeb4c2586
Simplify vars_possibly_in_scope types
2017-12-02 13:32:20 -05:00
Matthew Brown
6c9d90850a
Don’t complain when there are duplicate clauses if due to an assignment
...
Fixes #356
2017-11-28 22:17:03 -05:00
Matt Brown
1173dcc6a2
Don’t stop reconciling types when encountering problem
2017-11-28 17:42:00 -05:00
Matt Brown
33f003f427
Don’t complain about repeat isset calls on array keys
...
Fixes #347
2017-11-28 16:52:52 -05:00
Matthew Brown
f27bd50abe
Add RedundantCondition issue, replacing FailedTypeResolution ( #344 )
...
* Group changes
* Don’t worry about vars defined before exiting
* Fix issues with vars defined in conditionals
* Add failing test
* Only add failed reconciliation flag if nothing could be salvaged
* Avoid notice when removing clauses
* Improve handling of loops
* Fix evaluation of binary op expressions
* Remove unset vars from outer context after loop
* Ignore RedundantCondition in some more configs
2017-11-28 00:46:41 -05:00
Matthew Brown
f16642dad2
Better switch analysis ( #343 )
...
* Experiment with good switch analysis
* Improve switch accuracy at expense of some processor cycles
* Evaluate switch case expression in case context
2017-11-28 00:25:21 -05:00
Matthew Brown
18cf05e087
Always keep track of assigned var ids
2017-11-25 11:21:45 -05:00
Matthew Brown
c86e73ddb6
Always keep track of referenced var ids
...
which we can use for analysis elsewhere
2017-11-24 12:17:28 -05:00
Matthew Brown
fd3de443b2
Update loop with union of existing types
2017-11-21 22:13:46 -05:00
Matthew Brown
ae799da8d0
Add root array var when updating array key type in if
2017-11-19 23:25:14 -05:00
Tyson Andre
b3505cfbef
Get rid of unused variables in psalm's codebase ( #272 )
...
* Remove unused variables
* Fix more unused variables
* Fix remaining detected undefined variables
Other 20 detected undefined variable warnings were false positives.
2017-11-08 23:14:27 -05:00
Matthew Brown
73694ab04e
Suggest types when complaining of untype params
...
Ref #204
2017-09-02 18:15:52 -04:00
Matthew Brown
4175295113
Isolate where we load static storage objects ( #195 )
...
* Move FileChecker::$storage calls to provider
* Add ClassLikeStorageProvider
* Use ClassLikeStorageProvider everywhere
* Move storage arrays into providers
2017-07-29 15:05:06 -04:00
Matthew Brown
bc35f88859
Fix issue with $this instanceof checks in traits
2017-06-23 00:39:37 -04:00
Matt Brown
f49d167a49
Add tracking from where a trait was included
2017-06-21 14:22:52 -04:00
Matthew Brown
22a716f4da
Improve formatting of phpdocs
2017-05-26 20:16:18 -04:00
Matthew Brown
7532e32b9d
Fixed spacing and use statement formatting
2017-05-19 00:48:26 -04:00
Jon Ursenbach
f65c618b2e
PSR-2 adjustments and adding PHPCS checks into the Travis config. ( #149 )
...
* PSR-2 adjustments and adding PHPCS checks into the Travis config.
* Reverting some CallChecker changes and no longer casting vars to null.
2017-04-28 00:31:55 -04:00
Matthew Brown
dcedd65215
Add check for paradoxical statements
2017-04-02 15:26:10 -04:00
Matthew Brown
83edf8c4db
Complete the circle – fix remaining type algebra issue
2017-04-01 19:04:49 -04:00
Matthew Brown
2d88e237f4
Make method non-static
2017-03-19 13:23:19 -04:00
Matthew Brown
cb2ed860fb
Make sure to invalidate clauses in all parent contexts when asserting
2017-03-18 15:24:14 -04:00
Matthew Brown
3452c7853f
Add support for capturing clauses from elseifs
2017-03-18 14:04:26 -04:00
Matthew Brown
c33e66813a
Move type algebra functionality to separate checker
2017-03-18 13:37:00 -04:00
Matt Brown
30e8e1880d
Add another easy calculation of clauses
2017-03-16 14:45:45 -04:00
Matt Brown
cecfe25df7
Update outer clauses in mic drop situation
2017-03-16 11:46:07 -04:00
Matthew Brown
6cfe540c98
Fix issue evaluating elseif empty assertions
2017-03-14 15:48:52 -04:00
Matthew Brown
9dd94d099f
Fix issue with possibly-redefined switch vars
2017-03-14 02:00:38 -04:00