AndrolGenhald
57b99be519
Improve reference support for assertions, array offsets, and properties.
2022-01-26 12:55:47 -06:00
AndrolGenhald
0fb0632e0d
Infer type from known ternary condition.
2022-01-22 17:06:54 -06:00
Matthew Brown
0a81f8cd6c
Use objects, not strings, for assertions ( #7410 )
...
* Use objects, not strings, for assertions
* Remove unnecessary param
* Remove some unnecessary checks
* Fix bad find/replace
* Add note about assertions no longer stored as strings in UPGRADING.md
2022-01-20 17:33:06 -05:00
Bruce Weirdan
8726065d21
Applied ClosureToArrowFunctionRector
2022-01-06 00:48:04 +02:00
rarila
97e6511fab
Set number of lines before and after namespace.
2021-12-15 04:58:32 +01:00
rarila
39402c233d
Return type hints ( #7065 )
...
Co-authored-by: ralila <>
2021-12-05 19:51:26 +02:00
ralila
f833085a15
Fix fqn usage in php-doc
2021-12-04 03:37:19 +01:00
ralila
2a956498bf
Import instead of using fqn functions
2021-12-03 21:07:25 +01:00
ralila
711be643c6
Import instead of using fqn exceptions
2021-12-03 20:29:06 +01:00
ralila
245920e53c
Import instead of using fqn
2021-12-03 20:11:20 +01:00
ee8c5c9c35
Remove some array_values
2021-11-26 21:47:17 +01:00
orklah
0339815070
fix type leaking when using ternaries
2021-10-23 18:58:05 +02:00
orklah
0825f220fe
allow ternary to override previous type when reassigning
2021-09-04 20:22:06 +02:00
Bruce Weirdan
6abce3525a
Enforce use
sort ( #5900 )
2021-06-07 22:55:21 -04:00
Matt Brown
b8f5d16e9f
Consolidate similar functionality
2020-11-07 00:58:20 -05:00
Matt Brown
45b3dce631
Break apart IfElseAnalyzer
2020-11-06 21:01:17 -05:00
Matt Brown
3359e7699a
Rename IfAnalyzer
2020-11-06 20:51:14 -05:00
Matt Brown
b35db3e523
Reorganise things a little
2020-11-03 16:15:54 -05:00
orklah
ffe7874906
Misc improvements ( #4314 )
...
* extract the operation out of the loop when possible
* remove unnecessary interfaces when already inherited in parent
* simplify expressions
* avoid using alias functions
* redundant phpdoc
* unused imports
2020-10-15 13:23:35 -04:00
Matt Brown
14efde286f
4.x - refactor unused variable detection
...
This turns unused variable detection into an explicit control-flow problem, where before we had a more simplistic mark-and-sweep algorithm
2020-09-30 12:28:13 -04:00
orklah
ead107fa9e
More return types ( #4173 )
...
* add native return types
* redundant phpdoc
2020-09-12 11:24:05 -04:00
Brown
bd27e8b17b
Fix #4109 - detect duplicate match condition
2020-09-02 20:08:09 -04:00
Brown
988e17f11d
Make clause fully immutable
2020-08-26 15:35:29 -04:00
Brown
8ad1c2eeb1
Use immutable data structures for clause calculations
2020-08-26 10:41:47 -04:00
Brown
5ee1487a01
Make ExpressionAnalyzer more beautiful
2020-05-18 15:13:27 -04:00
Matthew Brown
bfb919d26a
Break out methods into their own classes
2020-03-11 23:04:52 -04:00
Matthew Brown
55c2f7faa2
Fix #2508 - don’t replace templated types with generic ones inside own function
2019-12-28 18:38:02 -05:00
Matthew Brown
ce9435da19
Fix #2521 - use correct context class when analysing trait
2019-12-28 15:56:26 -05:00
Matthew Brown
8f25183784
Fix #2459 - don’t add assertions to parent context unnecessarily
2019-12-12 00:37:00 -05:00
Matthew Brown
02fbf12337
Only warn about clauses in the currently-scanned conditional
2019-12-08 16:35:56 -05:00
Matthew Brown
83b10bb9af
Fix #2426 , or at least some of it
2019-12-08 00:49:34 -05:00
Brown
ef44bd104e
Consolidate some fixes from the binaryop branch
2019-12-06 12:47:27 -05:00
Brown
0bcb7863f3
Use better system for storing inferred types and assertions
2019-11-25 11:44:54 -05:00
Brown
00be4c2071
Mark var as unused
2019-11-13 15:06:22 -05:00
Brown
c9e7dcfa92
Fix false positive UnusedVariable
2019-11-13 14:32:27 -05:00
Brown
7b719915f5
Fix style things
2019-11-12 10:21:27 -05:00
Brown
7f5af741f7
Improve assertion calculation on mixed vars
2019-11-12 10:12:07 -05:00
Brown
b5614d03f8
Add detection for unused function calls
2019-08-13 13:15:23 -04:00
Matthew Brown
60c0133fff
Break apart reconciler
2019-08-10 13:22:21 -04:00
LeSuisse
f29826b958
Fully qualify constants and function calls ( #1849 )
...
This should give a small performance boost.
Part of #1837 .
The change is enforced via phpcs and can be autofixed
with phpcbf.
2019-06-26 16:52:29 -04:00
Matthew Brown
c66a106622
Improve performance by doing less cloning
...
Ref #1837
2019-06-26 00:14:06 -04:00
Brown
86bf159bd0
Avoid false positive for param
2019-05-02 15:33:47 -04:00
Brown
4f26c8d749
Fix #1597 - ternary else should only know about first conditional expression
2019-05-02 13:43:18 -04:00
Matthew Brown
8bc17e47be
Fix #1227 - allow genric params in @psalm-assert
2019-01-22 23:42:54 -05:00
Brown
ca1a615026
Don’t call reconciliation on empty vars
2018-12-17 15:23:56 -05:00
Matthew Brown
fd0ab47b80
Fix #1118 - detect possible issues with unions of mixed
2018-12-08 13:18:55 -05:00
Matthew Brown
b32000fa05
Fix #689 - add checks for @internal annotations
2018-12-01 18:37:49 -05:00
Brown
254a14f621
Allow assertion redundant conditions to be suppressed
2018-11-14 13:44:20 -05:00
Matthew Brown
4d79b61e93
Change _checker to _analyzer
2018-11-12 11:20:59 -05:00
Matthew Brown
4688b25fd9
Move internal classes to own namespace
2018-11-12 11:20:59 -05:00