Matt Brown
d1807cfb95
Improve checks for switch types
2017-09-11 11:58:11 -04:00
Matthew Brown
73694ab04e
Suggest types when complaining of untype params
...
Ref #204
2017-09-02 18:15:52 -04:00
Matt Brown
4b5a5ead74
Fix paradox detection for multiple clauses
2017-08-07 18:38:38 -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
e29dd140e3
Refactor scanning and analysis, introducing multithreading ( #191 )
...
* Add failing test
* Add visitor to soup up classlike references
* Move a whole bunch of code into the visitor
* Move some methods back, move onto analysis stage
* Use the getAliases method everywhere
* Fix refs
* Fix more refs
* Fix some tests
* Fix more tests
* Fix include tests
* Shift config class finding to project checker and fix bugs
* Fix a few more tests
* transition test to new syntax
* Remove var_dump
* Delete a bunch of code and fix mutation test
* Remove unnecessary visitation
* Transition to better mocked out file provider, breaking some cached statement loading
* Use different scheme for naming anonymous classes
* Fix anonymous class issues
* Refactor file/statement loading
* Add specific property types
* Fix mapped property assignment
* Improve how we deal with traits
* Fix trait checking
* Pass Psalm checks
* Add multi-process support
* Delay console output until the end
* Remove PHP 7 syntax
* Update file storage with classes
* Fix scanning individual files and add reflection return types
* Always turn XDebug off
* Add quicker method of getting method mutations
* Queue return types for crawling
* Interpret all strings as possible classes once we see a `get_class` call
* Check invalid return types again
* Fix template namespacing issues
* Default to class-insensitive file names for includes
* Don’t overwrite existing issues data
* Add var docblocks for scanning
* Add null check
* Fix loading of external classes in templates
* Only try to populate class when we haven’t yet seen it’s not a class
* Fix trait property accessibility
* Only ever improve docblock param type
* Make param replacement more robust
* Fix static const missing inferred type
* Fix a few more tests
* Register constant definitions
* Fix trait aliasing
* Skip constant type tests for now
* Fix linting issues
* Make sure caching is off for tests
* Remove unnecessary return
* Use emulative parser if on PHP 5.6
* Cache parser for faster first-time parse
* Fix constant resolution when scanning classes
* Remove test that’s beyond a practical scope
* Add back --diff support
* Add --help for --threads
* Remove unused vars
2017-07-25 16:11:02 -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
6b2b80d0bb
Assign var to correct context
2017-06-13 00:09:15 -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
688a72c794
Fix #36 - emit issues on deprecated properties
2017-05-25 01:32:34 -04:00
Matthew Brown
4fd46e1752
Improve formatting
2017-05-24 22:07:49 -04:00
muglug
65d86d35ad
Separate iterator issues
2017-05-22 11:59:58 -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
ce6ca58291
Fix #114 - add optional Hack-like checks calls
2017-04-14 21:32:14 -04:00
Matt Brown
7bcf7f13b1
Fix #137 - add for init in main scope
2017-04-11 17:43:46 -04:00
Matt Brown
14bb967c7d
Warn when doing === comparisons on incompatible types
2017-04-06 14:53:45 -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
b1b7b0ae35
Only include vars asserted in where
2017-03-18 16:34:44 -04:00
Matthew Brown
9a3049b5bc
Make sure switch contexts know their parents
2017-03-18 15:28:59 -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
9b41bc9b37
Add slower (but more accurate) loop checks
2017-03-14 20:14:25 -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
Matthew Brown
50b629e88e
Update context types after switch statement without default case
2017-03-13 21:17:21 -04:00
Matt Brown
3d2be3410e
Infer loop types without @var comments
2017-03-13 18:06:56 -04:00
Matt Brown
ae0ca9553f
Remove training wheels
2017-03-13 12:02:28 -04:00
Matt Brown
fa63afc27d
Change property name
2017-03-13 11:23:26 -04:00
Matthew Brown
a7da88bad3
Improve solution to allow for more user errors
2017-03-11 12:32:27 -05:00
Matthew Brown
5cd1b6735f
Add even more references in docblocks
2017-03-01 22:27:52 -05:00
Matt Brown
864d242f13
Improve labelling of referencing expressions
2017-03-01 11:56:36 -05:00
Matthew Brown
cd5f727d2e
Collect explicit references to classes/methods
2017-02-26 23:09:18 -05:00
Matthew Brown
fa3b292fd4
Fix #101 - restrict the values of pass-by-ref variables
2017-02-23 00:25:28 -05:00
Matthew Brown
48335b6fee
Fix potential invalid arg
2017-02-22 00:42:50 -05:00
Matt Brown
a56456a719
Add merging of vars_possibly_in_scope back
2017-02-21 17:41:54 -05:00
Matt Brown
fa35c0efa9
Remove changed vars from clauses in while loop to prevent re-application of logic
2017-02-21 17:19:15 -05:00
Matt Brown
2c7ffb6f4c
Add support for negating some while assertions
2017-02-21 16:52:27 -05:00
Matthew Brown
7cd1b27ff1
Add more support for logical and/or
2017-02-16 21:00:45 -05:00
Matthew Brown
a4323359d3
Fix ternary/which/for conditionals
2017-02-12 18:47:02 -05:00
Matthew Brown
81e24de76f
Fix invalid NullPropertyFetch warning
2017-02-12 18:06:18 -05:00
Matt Brown
32d85e20da
Remove unused vars
2017-02-10 19:10:13 -05:00
Matt Brown
2c1622e7de
Find more unreferenced variables by ignoring mass context ops
2017-02-10 19:08:55 -05:00
Matt Brown
c0a6fc9125
Fix #90 - add genericised stubs for common array functions
2017-02-10 18:12:59 -05:00
Matthew Brown
cdcacc395d
Rename DeadCode to UnusedVariable, UnusedMethod and UnusedClass
2017-02-08 00:28:26 -05:00
Matt Brown
f4857eb0dd
Make dead code check emit an issue
2017-02-07 18:18:33 -05:00
Matt Brown
6b2bb7d917
Store first code location for all variables in a statement list
2017-02-07 18:09:12 -05:00
Matthew Brown
0fbf8b5619
Remove more dead code
2017-02-02 00:45:23 -05:00
Matthew Brown
d3abc0011d
Fix #80 - add dead code checks via command line
2017-01-31 23:24:33 -05:00
Matthew Brown
7f8a3d798e
Improve clause resolution in while loops
2017-01-31 01:30:11 -05:00
Matthew Brown
965a79251d
Fix #82 by updating how isset calls are handled
2017-01-31 00:34:06 -05:00
Matthew Brown
7d912fc214
Remove vars when they’ve been changed
2017-01-30 22:26:41 -05:00
Matt Brown
a2750a92aa
Evaluate loop part of for after body
2017-01-18 17:13:20 -05:00
Matthew Brown
03141e41c2
Move string-stored types into named classes
2017-01-15 10:22:05 -05:00
Matthew Brown
bf76843d94
Fix foreach dependency errors
2017-01-09 00:58: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
694da2cabd
Simplify a lot of APIs
2017-01-07 14:35:07 -05:00
Matthew Brown
7609ca02c0
Fix #32 by evaluating all class references in files lazily
2017-01-04 23:42:58 -05:00
Matthew Brown
641ffc09c9
Add NullOperand issue for easy ignoring
2016-12-29 00:32:12 -05:00
Matthew Brown
b6455a2566
Improve how we disable clauses
2016-12-28 18:55:16 -05:00
Matthew Brown
63a75108f5
Evaluate more expressions up front
2016-12-28 17:04:03 -05:00
Matthew Brown
797875ba9a
Fix #10 - allow negated assignments
2016-12-28 16:29:50 -05:00
Matthew Brown
ea30af8a5a
Move assertion checks into separate file
2016-12-28 15:52:44 -05:00
Matthew Brown
4919252260
Fix leaking ref in SwitchChecker
2016-12-28 14:38:16 -05:00
Matthew Brown
6972c45c14
Remove vars from parent clauses when they are reconciled with vars
2016-12-28 14:20: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
1fe0eee8e4
Add generic type coercion checks
2016-12-25 01:08:58 +00: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
1e8f986d8c
Narrow down error lines for reconcileKeyedTypes
2016-12-11 13:59:36 -05:00
Matthew Brown
562f71b21f
Add TypeDoesNotContainType issue and fix those issues in Psalm code
2016-12-11 13:48:11 -05:00
Matt Brown
e6ff24b8d2
Fix assignment in elseif
2016-12-09 12:06:14 -05:00
Matt Brown
260a6d4df5
Make class errors more specific
2016-12-08 17:15:51 -05:00
Matt Brown
55a060b53a
Add support for closure checks
2016-12-07 14:13:39 -05:00
Matt Brown
48e19fc7e5
Add support for closure docblocks
2016-12-06 19:41:52 -05:00
Matthew Brown
ef1049224d
Add selection of return types in code preview
2016-12-06 16:33:47 -05:00
Matthew Brown
03d8a4ab0b
Add support for array destructuring with keys
2016-12-04 14:14:00 -05:00
Matthew Brown
b912dd2777
Add support for array destructuring
2016-12-04 13:35:38 -05:00
Matthew Brown
0675e3364a
Fix PHPParser 3.0.1 compatibility issues
2016-12-03 22:41:45 -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
Matthew Brown
87bb4a2f52
Fix various issues with docblock updates
2016-11-13 01:43:51 -05:00
Matthew Brown
05ae7905d9
Refactor IfChecker to break apart massive method
2016-11-11 17:13:30 -05:00
Matthew Brown
264e77addd
Change a few more words
2016-11-07 19:16:51 -05:00
Matthew Brown
36fc49965b
Correct speling
2016-11-07 17:31:02 -05:00
Matthew Brown
622a0794c3
Swap in Fully-Qualified for Absolute terms
2016-11-07 17:29:51 -05:00
Jon Ursenbach
27c2db1d1d
PSR-2
2016-11-02 17:50:54 -04:00
Matthew Brown
b31ac4a862
Removed object-like type descriptor in favour of array{} syntax
2016-10-28 13:24:06 -04:00
Matthew Brown
d8b10a6c97
Fix errors caught by Psalm
2016-10-23 01:57:11 -04:00
Matthew Brown
f3f1ba1caa
Break out block checkers
2016-10-22 17:35:59 -04:00
Matthew Brown
2bea64ca52
Split out SwitchChecker
2016-10-22 13:37:06 -04:00
Matthew Brown
e4ba8b1abc
Make StatementsChecker much smaller
2016-10-22 13:28:40 -04:00