Matthew Brown
fb300baa6d
Move a bunch of code into Codebase
2018-02-01 00:50:01 -05:00
Matthew Brown
e0fa3adb6f
Split up CallChecker to speed up Psalm
2018-01-28 18:29:38 -05:00
Matthew Brown
44b8b22995
Improve checks for unused variables and params
2018-01-28 17:28:34 -05:00
Matthew Brown
dd32452d90
Remove more dead code found by Psalm
2018-01-28 12:43:19 -05:00
Matt Brown
a2d11cce51
Fix static/self return type handling
2018-01-26 13:51:00 -05:00
Matt Brown
543872f186
Allow @psalm-ignore-falsable-return annotation
...
Downgrades issues around use of current(), reset(), end() etc.
2018-01-24 18:52:58 -05:00
Matthew Brown
68b00ea49a
Add automatic fix for PossiblyUndefinedVariable
2018-01-21 16:24:20 -05:00
Matthew Brown
bc9761f6c9
Create Codebase out from ProjectChecker
2018-01-21 13:45:33 -05:00
Matthew Brown
bd6e4a09bd
Refactor to break up too-large-files
2018-01-14 12:09:40 -05:00
Matthew Brown
e402ae978a
Fix Array_ items nullability
2018-01-13 18:33:32 -05:00
Matt Brown
21eafd8bfc
Fix #352 with a mixed copout if the use is passed by reference
2018-01-12 12:33:26 -05:00
Matthew Brown
7fa541e39b
Allow reference-returning functions to be passed as arguments of byref functions
2018-01-11 23:18:13 -05:00
Matt Brown
27e47365e3
Fix #422 - be better about checking isset call variables
2018-01-09 19:33:39 -05:00
Matt Brown
3b5ddb8dc2
Reduce use of __toString and remove profiling
2018-01-09 15:44:31 -05:00
Matt Brown
edde8930af
Speed up Psalm by caching result of Union::getId
2018-01-09 15:05:48 -05:00
Matthew Brown
8a8253ac4c
Fix indentation
2018-01-02 21:23:48 -05:00
Matthew Brown
81cfe09fae
Improve reporting of classlike locations in docblocks
2018-01-01 20:04:03 -05:00
Matthew Brown
2d24f9e99d
Don’t complain about unused variables when they’re passed by reference
2017-12-30 09:30:02 -05:00
Matthew Brown
c38cf9b672
Migrate type reconciliation code to its own class
2017-12-29 10:55:53 -05:00
Matthew Brown
c5ea5178e1
Remove unnecessary issue type
2017-12-22 16:09:56 +01:00
Matthew Brown
17edb2bbe6
Add better understanding of arrays with keyed integer offsets ( #400 )
...
* Add tests for keyed integer assignemnt
* First pass to get keyed integer assignment working
* Fix array assignment to object-like with different key type
* Improve treatment of objectlikes for callable and iterable comparisons
* Fix array assignment to strings and addition
* Convert expression to CNF
* Do better at merging property types
* Fix array_rand key type
2017-12-18 18:47:17 -05:00
Matthew Brown
2ec09b26d2
Clone all types on assignment
2017-12-17 23:22:26 -05:00
Matthew Brown
2011b8fb8f
Remove dead code
2017-12-16 10:51:04 -05:00
Matt Brown
eca7351472
Add return-level issues as well as function-level ones
...
Fixes #379
2017-12-07 15:50:25 -05:00
Matthew Brown
e08b11b144
Improve TemplateChecker
2017-12-06 01:05:51 -05:00
Matthew Brown
0eedad4f6a
Add UndefinedGlobalVariable issue and asssociated Possibly... one
2017-12-06 00:56:00 -05:00
Matthew Brown
a87a1f0dc9
Make sure undeclared array offset vars have type mixed
...
Fixes #360
2017-12-06 00:35:41 -05:00
Matthew Brown
59b50bdcdd
Add proper types for magic constants
...
Fixes #362
2017-12-06 00:05:01 -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
a8a1489a8f
Fix closure naming convention so it doesn’t confuse method id checks
2017-12-05 01:47:49 -05:00
Matthew Brown
69ca6bd0a0
Get LHS clauses of && expression after evaluation
2017-12-03 18:33:54 -05:00
Matthew Brown
02dcb2be95
Get or LHS clauses after evaluating statements
2017-12-03 18:22:25 -05:00
Matt Brown
062d46c132
Update to latest php-cs-fixer
2017-11-30 19:00:09 -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
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
4312ef380b
Fix issues found by improved Psalm checks
...
cc @TysonAndre, found with RedundantCondition checks
2017-11-24 12:10:30 -05:00
Matthew Brown
5ff4badf33
Refactor array analysis to improve reliability and accuracy ( #325 )
2017-11-19 12:33:43 -05:00
Matthew Brown
440db3be89
Fix #313 - correctly analyse closure self return types
2017-11-16 20:06:00 -05:00
Matthew Brown
2e6b93e4d0
Fix #289 , make inferred type of yield from expressions mixed
2017-11-14 22:29:15 -05:00
Matthew Brown
3ade4b9559
Fix #293 , be case invariant to self & static
2017-11-14 21:56:29 -05:00
Matthew Brown
b2ae9a2892
Fix #291 , #292 and #297 by improving docblock parsing
2017-11-14 21:43:31 -05:00
Matthew Brown
2f1e3652b7
Fix #274 - improve array addition inference for objectlike arrays
2017-11-11 14:19:57 -05:00
Matt Brown
e49573e7f6
Fix #279 - make sure referenced vars updated always in or
2017-11-09 16:42:39 -05:00
Matt Brown
ff5ea32ea3
Fix #277 - infer stdClass from object cast
2017-11-09 15:58:09 -05:00
Matthew Brown
765d82548d
Remove more dead code
2017-11-08 23:27:51 -05:00
Matt Brown
e0371aed62
Introduce file manipulation concept to plugins
2017-11-07 14:46:53 -05:00
Matthew Brown
45df0292b1
Never constrain by-ref array variables
2017-10-28 15:33:29 -04:00
Matt Brown
c850ef644d
Add PossiblyFalseReference and PossiblyFalseArgument issues
...
Useful for catching error cases
2017-10-23 11:47:00 -04:00
Matthew Brown
f6e01b5925
Change empty type assertions to "falsy"
...
As empty has a special meaning
2017-10-22 11:57:41 -04:00
Matthew Brown
1b7a5c2944
Fix #236 - incorrect operand issue text
2017-10-12 08:51:57 -04:00