@@ -95,13 +95,16 @@ protected function initBuilder(string $main): self
95
95
* @param string $directory The directory to scan for contents
96
96
* @param ?string $extensions Filter on extension, may be "php" or "(php|phtml)"
97
97
*
98
+ * @return int The number of added files
98
99
*/
99
- protected function addDirectory (string $ directory , string $ extensions = null )
100
+ protected function addDirectory (string $ directory , string $ extensions = null ): int
100
101
{
101
102
$ filter = ($ extensions ) ? sprintf ('/\.%s$/ ' , $ extensions ) : '' ;
102
103
$ files = Directory::find ($ directory , $ filter );
103
104
104
105
array_walk ($ files , function ($ file ) { $ this ->addFile ($ file ); });
106
+
107
+ return count ($ files );
105
108
}
106
109
107
110
/**
@@ -138,7 +141,9 @@ protected function addDirectories(array $dirs): self
138
141
$ wildcard = $ extensions ? "*. $ extensions " : 'all ' ;
139
142
$ this ->info ("Scanning directory <strong> $ directory</strong> for <strong> $ wildcard</strong> files... " );
140
143
141
- $ this ->addDirectory ($ directory , $ extensions );
144
+ $ count = $ this ->addDirectory ($ directory , $ extensions );
145
+
146
+ $ this ->info ("Added {$ count } files. " , 'grey ' );
142
147
}
143
148
144
149
return $ this ;
@@ -212,8 +217,9 @@ protected function setNotice(string $banner = null): self
212
217
*/
213
218
protected function publish (string $ output , bool $ shebang , string $ compression = 'GZ ' ): self
214
219
{
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 ' );
217
223
218
224
return $ this ;
219
225
}
0 commit comments