@@ -87,9 +87,7 @@ public function setResourceLimits(ResourceLimits $resourceLimits): EnvironmentFa
8787
8888 public function setRethrowErrors (bool $ rethrowErrors = true ): EnvironmentFactory
8989 {
90- $ this ->defaultRenderContextOptions = new RenderContextOptions (
91- strictVariables: $ this ->defaultRenderContextOptions ->strictVariables ,
92- strictFilters: $ this ->defaultRenderContextOptions ->strictFilters ,
90+ $ this ->defaultRenderContextOptions = $ this ->defaultRenderContextOptions ->cloneWith (
9391 rethrowErrors: $ rethrowErrors ,
9492 );
9593
@@ -98,21 +96,26 @@ public function setRethrowErrors(bool $rethrowErrors = true): EnvironmentFactory
9896
9997 public function setStrictVariables (bool $ strictVariables = true ): EnvironmentFactory
10098 {
101- $ this ->defaultRenderContextOptions = new RenderContextOptions (
99+ $ this ->defaultRenderContextOptions = $ this -> defaultRenderContextOptions -> cloneWith (
102100 strictVariables: $ strictVariables ,
103- strictFilters: $ this ->defaultRenderContextOptions ->strictFilters ,
104- rethrowErrors: $ this ->defaultRenderContextOptions ->rethrowErrors ,
105101 );
106102
107103 return $ this ;
108104 }
109105
110106 public function setStrictFilters (bool $ strictFilters = true ): EnvironmentFactory
111107 {
112- $ this ->defaultRenderContextOptions = new RenderContextOptions (
113- strictVariables: $ this ->defaultRenderContextOptions ->strictVariables ,
108+ $ this ->defaultRenderContextOptions = $ this ->defaultRenderContextOptions ->cloneWith (
114109 strictFilters: $ strictFilters ,
115- rethrowErrors: $ this ->defaultRenderContextOptions ->rethrowErrors ,
110+ );
111+
112+ return $ this ;
113+ }
114+
115+ public function setLazyParsing (bool $ lazyParsing = true ): EnvironmentFactory
116+ {
117+ $ this ->defaultRenderContextOptions = $ this ->defaultRenderContextOptions ->cloneWith (
118+ lazyParsing: $ lazyParsing ,
116119 );
117120
118121 return $ this ;
0 commit comments