Matthew Brown
a0c27cee4f
Allow param types to be inferred from presence of concat ops
2017-09-02 19:23:00 -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
e5c25eae97
Fix #172 - make sure new coalesce vars escape brackets
2017-06-20 15:38:32 -04:00
Matt Brown
e1d5eab7a2
Fix long line
2017-06-20 14:07:54 -04:00
Matt Brown
473040ca8f
Fix #171 by supporting exit statements for fopen
2017-06-20 13:25:37 -04:00
Matthew Brown
93e7486d5e
Reduce line length
2017-05-26 20:17:56 -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
Matthew Brown
7532e32b9d
Fixed spacing and use statement formatting
2017-05-19 00:48:26 -04:00
Matt Brown
cadaef14e6
Carry forward ignore_nullable_return in fleshOutType
2017-05-10 12:49:59 -04:00
github@muglug.com
9ff8736e53
Add the means to ignore PossiblyNull* errors from the type itself
2017-05-09 16:38:58 -04:00
Matt Brown
9cabf428c4
Only make isset $this->property mixed if not already defined
2017-04-28 16:41:54 -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
Matt Brown
bd6a623bfd
Fix possible empty type when inferredType not set
2017-04-21 16:33:18 -04:00
Matt Brown
f7daa6e768
Fix #143 by allowing scalar types to be passed through
2017-04-21 14:06:47 -04:00
Matthew Brown
2bdd062400
Ternary else should ignore if expression context
2017-04-15 13:46:18 -04:00
Vladimir Komissarov
818e3be00c
Fix undefined global constant in closure
2017-04-14 17:03:09 +07:00
SignpostMarv
46a0b03aac
enable the exposure of the source line number when DocblockParseException is thrown
2017-04-11 22:14:15 +01:00
Matthew Brown
40427839ea
Get all variables possibly assigned in conditional
2017-04-06 22:56:37 -04:00
Matthew Brown
20b0460a33
Fix #123 - ternary byref vars now adjusted
2017-04-06 21:53:29 -04:00
Matthew Brown
075cc5f50d
Add by-reference clause removal
2017-04-02 17:37:56 -04:00
Matt Brown
5b34163d8d
Add ability to insert suppressed issues on functions
2017-03-31 11:21:34 -04:00
Matthew Brown
066b1e011e
Prevent creating empty objectlike
2017-03-20 02:05:58 -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
c33e66813a
Move type algebra functionality to separate checker
2017-03-18 13:37:00 -04:00
Matthew Brown
9b41bc9b37
Add slower (but more accurate) loop checks
2017-03-14 20:14:25 -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
Matthew Brown
5cd1b6735f
Add even more references in docblocks
2017-03-01 22:27:52 -05:00
Matthew Brown
cd5f727d2e
Collect explicit references to classes/methods
2017-02-26 23:09:18 -05:00
Matthew Brown
8db6921f1c
More graceful early exit if not checking variables
2017-02-24 21:27:52 -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
9137727993
Fix #99 - treat null coalesce more respectfully
2017-02-17 20:50:47 -05:00
Matthew Brown
7cd1b27ff1
Add more support for logical and/or
2017-02-16 21:00:45 -05:00
Matthew Brown
2d58531631
Fix #98 - add support for logical and/or
2017-02-16 20:43:23 -05:00
Matthew Brown
500044dac1
Make sure $argv and $argc are not globally available
2017-02-12 22:12:31 -05:00
Matthew Brown
a87ea78efc
Fix variable-scoped byref issue
2017-02-12 19:07:25 -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
Matthew Brown
2635744f4e
Simplify array inferred type
2017-02-12 16:58:04 -05:00
Matthew Brown
8e7ab59e2b
Add return types for core vars
2017-02-12 12:22:39 -05:00
Matthew Brown
7876c7ffb9
Allow mixed to override null in byref assignment
2017-02-12 11:34:07 -05:00
Matthew Brown
bb9221ba01
Analyze die/exit expressions
2017-02-11 19:42:12 -05:00
Matthew Brown
f32fabd798
Remove dead code
2017-02-11 19:30:06 -05:00
Matthew Brown
35e4b380cc
Add collection of PossiblyNull* issues
2017-02-11 17:55:08 -05:00
Matthew Brown
dbddedb20b
Don’t create objectlike if we some properties are untyped
2017-02-10 23:35:34 -05:00
Matt Brown
32d85e20da
Remove unused vars
2017-02-10 19:10:13 -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
01beb97413
Fix #87 - array types from docblocks can be reasoned about safely
2017-02-03 22:07:14 -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
ff46487353
Be more discerning about unaryminus/plus inferred type
2017-01-25 21:50:34 -07:00
Matthew Brown
c14a19370f
Improve UnaryPlus/Minus still more
2017-01-25 20:23:06 -07:00
Matthew Brown
f03807e7b7
Fix unaryplus/minus type inference
2017-01-25 20:02:19 -07:00
Matthew Brown
0da9c10d36
Don’t complain when adding array and object-like array
2017-01-23 15:40:55 -07:00
Matt Brown
a67800cac7
Ignore cloning of mixed variables
2017-01-19 15:00:05 -05:00
Matthew Brown
9220b958eb
Fix phpcs errors
2017-01-16 19:06:39 -05:00
Matthew Brown
b3726c9de5
Use getcwd() for the project’s base, not the config file parent directory
2017-01-16 18:33:04 -05:00
Matthew Brown
e3a9cb98c3
Add extra issue for invalid clone and fix issue reporting;
2017-01-16 12:59:09 -05:00
Matthew Brown
5315fd15ad
Fix namespaced functions in regular use statements
2017-01-16 00:49:12 -05:00
Matthew Brown
ce89ac4986
Fix #50 - asserting about docblock types no longer causes error
2017-01-15 17:52:01 -05:00
Matthew Brown
faccc73dc1
Fix #52 by analysing non-main parts of issets
2017-01-15 13:58:20 -05:00
Matthew Brown
03141e41c2
Move string-stored types into named classes
2017-01-15 10:22:05 -05:00
Matt Brown
35c06261b9
Fix #38 - emit issue for non-array on right too
2017-01-13 13:09:52 -05:00
Matthew Brown
5f54a9571c
Fix deep project checks
2017-01-12 01:03:48 -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
0b3b3f01f3
Fix support for traits returning self
2016-12-31 11:49:04 -05:00
Matthew Brown
b068bd7858
Fix many bugs
2016-12-30 20:05:32 -05:00
Matthew Brown
21816723c7
Make config schema more relaxed about ordering and fix trait bugs
2016-12-30 01:51:29 -05:00
Matthew Brown
641ffc09c9
Add NullOperand issue for easy ignoring
2016-12-29 00:32:12 -05:00
Matthew Brown
18e7c65430
Emit more InvalidOperand issues
2016-12-29 00:14:06 -05:00
Matthew Brown
992e7ae256
Fix #1 - add in support for !==false-negating assertions in ifs
2016-12-28 16:39:05 -05:00
Matthew Brown
797875ba9a
Fix #10 - allow negated assignments
2016-12-28 16:29:50 -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
513fcea101
Only assign type when not null
2016-12-25 01:12:26 +00:00
Matthew Brown
c51d8f5220
Implement MixedOperand and InvalidOperand issues
2016-12-24 18:29:11 +00:00
Matthew Brown
c55870e26c
Allow generic TypeChecker::isContainedBy checks
2016-12-24 18:28:43 +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
144625f625
Add numeric check back, with caveats
2016-12-11 20:36:27 -05:00
Matthew Brown
1e8f986d8c
Narrow down error lines for reconcileKeyedTypes
2016-12-11 13:59:36 -05:00
Matthew Brown
73b1ab1411
Support int offsets in dealing with type inference
2016-12-10 18:24:28 -05:00
Matthew Brown
327e3150a2
Fix erroneous self-check
2016-12-10 15:08:38 -05:00
Matthew Brown
c3df70e634
Allow int offsets to be treated as keys
2016-12-10 15:01:59 -05:00
Matt Brown
ce3b24bf5f
Fix #8 - defer always to call map if function not user-defined
2016-12-09 12:07:47 -05:00
Matt Brown
c9557d47ce
Fix exponentiation and modulo type inference
2016-12-08 16:37:14 -05:00
Matt Brown
117645ac73
Account for off-by-one issue in PhpParser
2016-12-08 15:57:18 -05:00
Matt Brown
55a060b53a
Add support for closure checks
2016-12-07 14:13:39 -05:00
Matthew Brown
dcb9e1af14
Be more lenient when computing result of addition/subtraction
2016-12-04 18:41:33 -05:00
Matthew Brown
03d8a4ab0b
Add support for array destructuring with keys
2016-12-04 14:14:00 -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
4f95c67e1c
Emit issues for null/mixed array access
2016-11-21 19:07:56 -05:00
Matthew Brown
d542b22322
Add belt & braces file checking
2016-11-18 16:13:59 -05:00
Matthew Brown
f2ce83c8e5
Fix minor boop
2016-11-13 15:55:06 -05:00
Matthew Brown
fa2209719b
Fix nullref
2016-11-13 15:46:35 -05:00
Matthew Brown
409a7e4b9e
Fix assignment checks
2016-11-13 15:39:16 -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
Matthew Brown
3b038db454
Avoid missing property
2016-11-07 15:29:47 -05:00
Matthew Brown
721e0d01e2
Get rid of var_dumps
2016-11-05 20:53:39 -04:00
Matthew Brown
b3f3a20928
Correctly evaluate $this and self in property/return types
2016-11-05 18:31:09 -04:00
Matthew Brown
7c44353116
Add inferredType to InstanceOf_
2016-11-05 17:57:14 -04:00
Matthew Brown
c5591adf10
Add support for global in functions and mixed inferred return errors
2016-11-05 17:54:34 -04:00
Matthew Brown
7df4d74a7b
Fix Psalm errors
2016-11-04 21:14:04 -04:00
Jon Ursenbach
27c2db1d1d
PSR-2
2016-11-02 17:50:54 -04:00
Matthew Brown
88eb43e9ca
Break out ExpressionChecker
2016-11-01 14:14:41 -04:00
Matthew Brown
712752d587
Split out asssignment methods
2016-11-01 11:37:58 -04:00
Matthew Brown
34af24a2b4
Add all the properties
2016-11-01 00:39:41 -04:00
Matthew Brown
c2f63c392e
Emit issue if property type is missing
2016-10-31 15:17:54 -04:00
Matthew Brown
8fefaecd9c
Skip when encountering null list var
2016-10-30 19:59:26 -04:00
Matthew Brown
4d5b0abb74
Add explicit value tracking
2016-10-30 19:52:35 -04:00
Matthew Brown
b220ee51cc
Correctly assign list values
2016-10-30 19:38:08 -04:00
Matthew Brown
53cef386a2
Do not error on mixed input
2016-10-30 12:53:56 -04:00
Matthew Brown
6cd63cc0f3
Fix nullref
2016-10-30 12:51:41 -04:00
Matthew Brown
604c875d0c
Fix more errors caught by Psalm
2016-10-30 12:46:18 -04:00
Matthew Brown
722a7fba5c
Don't squeal when autoloading classes
2016-10-30 01:13:33 -04:00
Matthew Brown
98437c52db
Check closure params to see if they align with array_map/array_filter args
2016-10-29 22:17:46 -04:00
Matthew Brown
9f94add470
Update plugin interface to add $suppressed_issues
2016-10-28 16:49:42 -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
0b0a5ff0e8
Better check for bad static invocation
2016-10-28 10:22:45 -04:00
Matthew Brown
95f5a4603a
Add property for poorly-reflected builtin classes
2016-10-27 16:05:27 -04:00
Matthew Brown
357cd8ad41
Add support for Closure::__invoke
2016-10-24 15:55:05 -04:00
Matthew Brown
ce95275878
Fix more Psalm bugs found by Psalm
2016-10-23 12:24:53 -04:00
Matthew Brown
d8b10a6c97
Fix errors caught by Psalm
2016-10-23 01:57:11 -04:00
Matthew Brown
fbdfc78546
Fix references to moved fucntionality
2016-10-22 18:25:14 -04:00
Matthew Brown
f3f1ba1caa
Break out block checkers
2016-10-22 17:35:59 -04:00
Matthew Brown
dda4c52e03
Fix ref
2016-10-22 13:29:32 -04:00
Matthew Brown
e4ba8b1abc
Make StatementsChecker much smaller
2016-10-22 13:28:40 -04:00