@@ -58,8 +58,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
58
58
{
59
59
$ io = new SymfonyStyle ($ input , $ output );
60
60
61
- /** @var $kernel KernelInterface */
61
+ /** @var KernelInterface $kernel */
62
62
$ kernel = $ this ->getApplication ()->getKernel ();
63
+ $ projectDir = $ kernel ->getContainer ()->getParameter ('kernel.project_dir ' );
63
64
64
65
$ rows = array (
65
66
array ('<info>Symfony</> ' ),
@@ -74,8 +75,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
74
75
array ('Environment ' , $ kernel ->getEnvironment ()),
75
76
array ('Debug ' , $ kernel ->isDebug () ? 'true ' : 'false ' ),
76
77
array ('Charset ' , $ kernel ->getCharset ()),
77
- array ('Cache directory ' , self ::formatPath ($ kernel ->getCacheDir (), $ kernel -> getProjectDir () ).' (<comment> ' .self ::formatFileSize ($ kernel ->getCacheDir ()).'</>) ' ),
78
- array ('Log directory ' , self ::formatPath ($ kernel ->getLogDir (), $ kernel -> getProjectDir () ).' (<comment> ' .self ::formatFileSize ($ kernel ->getLogDir ()).'</>) ' ),
78
+ array ('Cache directory ' , self ::formatPath ($ kernel ->getCacheDir (), $ projectDir ).' (<comment> ' .self ::formatFileSize ($ kernel ->getCacheDir ()).'</>) ' ),
79
+ array ('Log directory ' , self ::formatPath ($ kernel ->getLogDir (), $ projectDir ).' (<comment> ' .self ::formatFileSize ($ kernel ->getLogDir ()).'</>) ' ),
79
80
new TableSeparator (),
80
81
array ('<info>PHP</> ' ),
81
82
new TableSeparator (),
@@ -101,9 +102,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
101
102
$ io ->table (array (), $ rows );
102
103
}
103
104
104
- private static function formatPath (string $ path , string $ baseDir = null ): string
105
+ private static function formatPath (string $ path , string $ baseDir ): string
105
106
{
106
- return null !== $ baseDir ? preg_replace ('~^ ' .preg_quote ($ baseDir , '~ ' ).'~ ' , '. ' , $ path ) : $ path ;
107
+ return preg_replace ('~^ ' .preg_quote ($ baseDir , '~ ' ).'~ ' , '. ' , $ path );
107
108
}
108
109
109
110
private static function formatFileSize (string $ path ): string
0 commit comments