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

44 Commits

Author SHA1 Message Date
Matthew Brown
b06cfd025a Allow continue inside case statement as alias for break
Fixes #464
2018-01-24 00:01:08 -05:00
Matthew Brown
68b00ea49a Add automatic fix for PossiblyUndefinedVariable 2018-01-21 16:24:20 -05:00
Matt Brown
edde8930af Speed up Psalm by caching result of Union::getId 2018-01-09 15:05:48 -05:00
Matthew Brown
c38cf9b672 Migrate type reconciliation code to its own class 2017-12-29 10:55:53 -05:00
Matt Brown
dd11a792fd Add trailing commas 2017-12-13 15:57:10 -05:00
Matt Brown
4b8c242f5d Create fake get_class/gettype statements where necessary 2017-12-13 15:56:05 -05:00
Matthew Brown
be3212eb42 Remove conflicting clauses from switch assertions 2017-12-03 00:58:24 -05:00
Matthew Brown
d20b8d3034
Improve loop analysis (#365) 2017-12-02 18:28:18 -05:00
Matthew Brown
ed626db553 Widen switch redefined vars if defined in each case 2017-12-02 18:06:21 -05:00
Matthew Brown
cfeb4c2586 Simplify vars_possibly_in_scope types 2017-12-02 13:32:20 -05:00
Matthew Brown
f4212d897c Fix erroneous empty array creation in SwitchChecker
Fixes #354
2017-11-28 22:33:37 -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
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
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
ad74563327 Improve handling of switch statements with default cases 2017-11-20 20:39:27 -05:00
Matthew Brown
7d33db0d19 Fix issue with array unification after scanning 2017-11-16 01:11:46 -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
4d32c72ef8 Fix #250 and fix #255 - handle switch statements like PHP does 2017-10-22 19:53:53 -04:00
Matt Brown
439a1ddc97 Exit early if a bad class is detected 2017-09-11 11:58:11 -04:00
Matt Brown
d1807cfb95 Improve checks for switch types 2017-09-11 11:58:11 -04:00
Matthew Brown
22a716f4da Improve formatting of phpdocs 2017-05-26 20:16:18 -04:00
Matthew Brown
d6909193ea Add additional formatting changes 2017-05-26 20:05:57 -04:00
Matthew Brown
4fd46e1752 Improve formatting 2017-05-24 22:07:49 -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
2d88e237f4 Make method non-static 2017-03-19 13:23:19 -04:00
Matthew Brown
9a3049b5bc Make sure switch contexts know their parents 2017-03-18 15:28:59 -04:00
Matthew Brown
9dd94d099f Fix issue with possibly-redefined switch vars 2017-03-14 02:00:38 -04:00
Matthew Brown
50b629e88e Update context types after switch statement without default case 2017-03-13 21:17:21 -04:00
Matt Brown
ae0ca9553f Remove training wheels 2017-03-13 12:02:28 -04:00
Matthew Brown
cd5f727d2e Collect explicit references to classes/methods 2017-02-26 23:09:18 -05:00
Matt Brown
32d85e20da Remove unused vars 2017-02-10 19:10:13 -05:00
Matthew Brown
d3abc0011d Fix #80 - add dead code checks via command line 2017-01-31 23:24:33 -05:00
Matthew Brown
03141e41c2 Move string-stored types into named classes 2017-01-15 10:22:05 -05:00
Matthew Brown
17329015dc Discriminate between checking, visiting and analyzing in method names 2017-01-07 15:09:47 -05:00
Matthew Brown
4919252260 Fix leaking ref in SwitchChecker 2016-12-28 14:38:16 -05:00
Matthew Brown
05834a0db3 Fix #13 by revamping how we treat type assertions in if statements and ternary expressions 2016-12-28 13:12:06 -05:00
Matthew Brown
9746c8972f Fix MixedAssignment errors 2016-12-17 00:48:31 -05:00
Matthew Brown
592ee98efc Fix bugs discovered by adding more tests 2016-12-11 23:40:46 -05:00
Matthew Brown
a1acbfec07 Show code snippets when reporting errors
This also introduces a new method of identifying specific code locations when creating issues
2016-12-03 19:11:30 -05:00
Jon Ursenbach
27c2db1d1d PSR-2 2016-11-02 17:50:54 -04:00
Matthew Brown
d8b10a6c97 Fix errors caught by Psalm 2016-10-23 01:57:11 -04:00
Matthew Brown
2bea64ca52 Split out SwitchChecker 2016-10-22 13:37:06 -04:00