File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ public function __construct(
6363 Cache $ cache ,
6464 private CacheForDocument $ cacheForDocument ,
6565 bool $ enableContextualLocation = false ,
66+ bool $ usePhpStanDocblock = false ,
6667 ) {
6768 $ sourceReflector = $ reflectorFactory ->create ($ this );
6869
@@ -90,10 +91,10 @@ public function __construct(
9091
9192 $ this ->sourceLocator = $ sourceLocator ;
9293
93- if (!true ) {
94- $ this ->docblockFactory = new DocblockParserFactory ($ this ->reflector );
95- } else {
94+ if ($ usePhpStanDocblock ) {
9695 $ this ->docblockFactory = new PHPStanDocblockParserFactory ($ this ->reflector );
96+ } else {
97+ $ this ->docblockFactory = new DocblockParserFactory ($ this ->reflector );
9798 }
9899
99100 $ this ->docblockFactory = new UnsupportedTagsParserFactory ($ this ->docblockFactory );
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ final class ReflectorBuilder
3636
3737 private bool $ enableContextualSourceLocation = false ;
3838
39+ private bool $ usePhpStanDocblock = true ;
40+
3941 private ?SourceCodeReflectorFactory $ sourceReflectorFactory = null ;
4042
4143 /**
@@ -144,7 +146,8 @@ public function build(): Reflector
144146 $ this ->memberContextResolvers ,
145147 $ this ->buildCache (),
146148 $ this ->cacheForDocument ?? new CacheForDocument (fn () => new NullCache ()),
147- $ this ->enableContextualSourceLocation
149+ $ this ->enableContextualSourceLocation ,
150+ $ this ->usePhpStanDocblock
148151 ))->reflector ();
149152 }
150153
You can’t perform that action at this time.
0 commit comments