1717use Humbug \PhpScoper \Configuration \ConfigurationFactory ;
1818use Humbug \PhpScoper \Configuration \RegexChecker ;
1919use Humbug \PhpScoper \Configuration \SymbolsConfigurationFactory ;
20+ use Humbug \PhpScoper \PhpParser \Printer \Printer ;
21+ use Humbug \PhpScoper \PhpParser \Printer \StandardPrinter ;
2022use Humbug \PhpScoper \Scoper \ScoperFactory ;
2123use Humbug \PhpScoper \Symbol \EnrichedReflectorFactory ;
2224use Humbug \PhpScoper \Symbol \Reflector ;
2325use PhpParser \Lexer ;
2426use PhpParser \Parser ;
2527use PhpParser \ParserFactory ;
28+ use PhpParser \PrettyPrinter \Standard ;
2629use Symfony \Component \Filesystem \Filesystem ;
2730
2831final class Container
@@ -33,6 +36,7 @@ final class Container
3336 private Reflector $ reflector ;
3437 private ScoperFactory $ scoperFactory ;
3538 private EnrichedReflectorFactory $ enrichedReflectorFactory ;
39+ private Printer $ printer ;
3640
3741 public function getFileSystem (): Filesystem
3842 {
@@ -63,6 +67,7 @@ public function getScoperFactory(): ScoperFactory
6367 $ this ->scoperFactory = new ScoperFactory (
6468 $ this ->getParser (),
6569 $ this ->getEnrichedReflectorFactory (),
70+ $ this ->getPrinter (),
6671 );
6772 }
6873
@@ -97,4 +102,15 @@ public function getEnrichedReflectorFactory(): EnrichedReflectorFactory
97102
98103 return $ this ->enrichedReflectorFactory ;
99104 }
105+
106+ public function getPrinter (): Printer
107+ {
108+ if (!isset ($ this ->printer )) {
109+ $ this ->printer = new StandardPrinter (
110+ new Standard (),
111+ );
112+ }
113+
114+ return $ this ->printer ;
115+ }
100116}
0 commit comments