@@ -95,13 +95,16 @@ protected function initBuilder(string $main): self
9595 * @param string $directory The directory to scan for contents
9696 * @param ?string $extensions Filter on extension, may be "php" or "(php|phtml)"
9797 *
98+ * @return int The number of added files
9899 */
99- protected function addDirectory (string $ directory , string $ extensions = null )
100+ protected function addDirectory (string $ directory , string $ extensions = null ): int
100101 {
101102 $ filter = ($ extensions ) ? sprintf ('/\.%s$/ ' , $ extensions ) : '' ;
102103 $ files = Directory::find ($ directory , $ filter );
103104
104105 array_walk ($ files , function ($ file ) { $ this ->addFile ($ file ); });
106+
107+ return count ($ files );
105108 }
106109
107110 /**
@@ -138,7 +141,9 @@ protected function addDirectories(array $dirs): self
138141 $ wildcard = $ extensions ? "*. $ extensions " : 'all ' ;
139142 $ this ->info ("Scanning directory <strong> $ directory</strong> for <strong> $ wildcard</strong> files... " );
140143
141- $ this ->addDirectory ($ directory , $ extensions );
144+ $ count = $ this ->addDirectory ($ directory , $ extensions );
145+
146+ $ this ->info ("Added {$ count } files. " , 'grey ' );
142147 }
143148
144149 return $ this ;
@@ -212,8 +217,9 @@ protected function setNotice(string $banner = null): self
212217 */
213218 protected function publish (string $ output , bool $ shebang , string $ compression = 'GZ ' ): self
214219 {
215- $ this ->info ("Writing Phar archive to <strong> $ output</strong>... " );
216- $ this ->builder ->compile ($ output , $ shebang , $ compression );
220+ $ this ->info ("Saving archive to <strong> $ output</strong>... " );
221+ $ size = $ this ->builder ->compile ($ output , $ shebang , $ compression );
222+ $ this ->info ("{$ size } bytes written. " , 'grey ' );
217223
218224 return $ this ;
219225 }
0 commit comments