@@ -312,11 +312,11 @@ private function printPackageState(IO $io, $packageState)
312312 /**
313313 * Prints a list of packages in a table.
314314 *
315- * @param IO $io The I/O.
316- * @param Package[] $packages The packages.
317- * @param string $styleTag The tag used to style the output. If `null`,
318- * the default colors are used.
319- * @param bool $indent Whether to indent the output.
315+ * @param IO $io The I/O.
316+ * @param Package[] $packages The packages.
317+ * @param string|null $styleTag The tag used to style the output. If `null`,
318+ * the default colors are used.
319+ * @param bool $indent Whether to indent the output.
320320 */
321321 private function printPackageTable (IO $ io , array $ packages , $ styleTag = null , $ indent = false )
322322 {
@@ -337,10 +337,10 @@ private function printPackageTable(IO $io, array $packages, $styleTag = null, $i
337337 $ env = $ installInfo ? $ installInfo ->getEnvironment () : Environment::PROD ;
338338
339339 $ table ->addRow (array (
340- $ styleTag ? " < $ styleTag> $ packageName</ $ styleTag> " : $ packageName ,
341- $ installer ? " < $ installerTag> $ installer</ $ installerTag> " : '' ,
342- " < $ envTag> $ env</ $ envTag> " ,
343- " < $ pathTag> $ installPath</ $ pathTag> " ,
340+ $ styleTag ? sprintf ( ' <%s>%s</%s> ' , $ styleTag, $ packageName, $ styleTag) : $ packageName ,
341+ $ installer ? sprintf ( ' <%s>%s</%s> ' , $ installerTag, $ installer, $ installerTag) : '' ,
342+ sprintf ( ' <%s>%s</%s> ' , $ envTag, $ env, $ envTag) ,
343+ sprintf ( ' <%s>%s</%s> ' , $ pathTag, $ installPath, $ pathTag) ,
344344 ));
345345 }
346346
@@ -380,7 +380,10 @@ private function printNotLoadablePackages(IO $io, array $packages, $indent = fal
380380 // Remove root directory
381381 $ errorMessage = str_replace ($ rootDir .'/ ' , '' , $ errorMessage );
382382
383- $ table ->addRow (array ("<bad> $ packageName</bad> " , "<bad> $ errorMessage</bad> " ));
383+ $ table ->addRow (array (
384+ sprintf ('<bad>%s</bad> ' , $ packageName ),
385+ sprintf ('<bad>%s</bad> ' , $ errorMessage ),
386+ ));
384387 }
385388
386389 $ table ->render ($ io , $ indent ? 4 : 0 );
0 commit comments