1313
1414class CompileCommand extends BaseCommand
1515{
16- /**
17- * @var \Cake\TwigView\View\TwigView
18- */
1916 protected TwigView $ twigView ;
2017
2118 /**
@@ -64,7 +61,7 @@ public function execute(Arguments $args, ConsoleIo $io)
6461 $ this ->twigView = new $ viewClass ();
6562
6663 // $type is validated by the 'choices' option in buildOptionsParser
67- return $ this ->{" execute { $ type}" }($ args , $ io );
64+ return $ this ->{' execute ' . $ type }($ args , $ io );
6865 }
6966
7067 /**
@@ -79,7 +76,7 @@ protected function executeAll(Arguments $args, ConsoleIo $io): int
7976 $ io ->info ('Compiling all templates ' );
8077
8178 foreach (Scanner::all ($ this ->twigView ->getExtensions ()) as $ section => $ templates ) {
82- $ io ->info (" Compiling section { $ section}" );
79+ $ io ->info (' Compiling section ' . $ section );
8380 foreach ($ templates as $ template ) {
8481 if ($ this ->compileFile ($ io , $ template ) === static ::CODE_ERROR ) {
8582 return static ::CODE_ERROR ;
@@ -106,7 +103,7 @@ protected function executePlugin(Arguments $args, ConsoleIo $io): int
106103 return static ::CODE_ERROR ;
107104 }
108105
109- $ io ->info (" Compiling plugin { $ plugin}" );
106+ $ io ->info (' Compiling plugin ' . $ plugin );
110107 foreach (Scanner::plugin ($ plugin , $ this ->twigView ->getExtensions ()) as $ template ) {
111108 if ($ this ->compileFile ($ io , $ template ) === static ::CODE_ERROR ) {
112109 return static ::CODE_ERROR ;
@@ -146,9 +143,9 @@ protected function compileFile(ConsoleIo $io, string $filename): int
146143 {
147144 try {
148145 $ this ->twigView ->getTwig ()->load ($ filename );
149- $ io ->success (" Compiled { $ filename} . " );
146+ $ io ->success (sprintf ( ' Compiled %s. ' , $ filename) );
150147 } catch (Exception $ exception ) {
151- $ io ->error (" Unable to compile { $ filename} . " );
148+ $ io ->error (sprintf ( ' Unable to compile %s. ' , $ filename) );
152149 $ io ->error ($ exception ->getMessage ());
153150
154151 return static ::CODE_ERROR ;
0 commit comments