Skip to content

Commit 3b55961

Browse files
committed
Refactor: Improve debug messages
1 parent 6b10898 commit 3b55961

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/Command/Compile.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public function execute()
5454

5555
$this
5656
->initBuilder($main)
57-
->setNotice($banner)
5857
->addDirectories($dirs)
58+
->setNotice($banner)
5959
->publish($output)
6060
->info('Build complete.')
6161
;
@@ -85,9 +85,6 @@ protected function initBuilder(string $main): self
8585
*/
8686
protected function addDirectory(string $directory, string $extensions = null)
8787
{
88-
$wildcard = $extensions ? "*.$extensions" : 'all';
89-
$this->info("Scanning directory <strong>$directory</strong> for <strong>$wildcard</strong> files ...");
90-
9188
$filter = ($extensions) ? sprintf('/\.%s$/', $extensions) : '';
9289
$files = Directory::find($directory, $filter);
9390

@@ -115,8 +112,12 @@ protected function addFile(string $file)
115112
protected function addDirectories(array $dirs): self
116113
{
117114
foreach ($dirs as $spec) {
118-
list($dir, $ext) = explode(':', $spec);
119-
$this->addDirectory($dir, $ext);
115+
list($directory, $extensions) = explode(':', $spec);
116+
117+
$wildcard = $extensions ? "*.$extensions" : 'all';
118+
$this->info("Scanning directory <strong>$directory</strong> for <strong>$wildcard</strong> files ...");
119+
120+
$this->addDirectory($directory, $extensions);
120121
}
121122

122123
return $this;
@@ -135,6 +136,8 @@ protected function setNotice(string $banner = null): self
135136
$this->info("Loading banner contents from <strong>$banner</strong> file ...");
136137
$contents = file_get_contents($banner);
137138
$header = $this->phpdocize($contents);
139+
140+
$this->info($header, 'grey');
138141
$this->builder->setBanner($header);
139142
}
140143

0 commit comments

Comments
 (0)