@@ -69,7 +69,7 @@ public static function pathFormat(string $dirName): string
6969 }
7070
7171 /**
72- * @param string $path e.g phar://E:/workenv/php-dockerized/www/phplang/ugirls-social/social-uem/uem .phar/web
72+ * @param string $path e.g phar://E:/workenv/xxx/yyy/app .phar/web
7373 * @return string
7474 */
7575 public function clearPharPath (string $ path ): string
@@ -116,7 +116,7 @@ public static function exists(string $file, $type = null)
116116 * @throws FileNotFoundException
117117 * @throws \InvalidArgumentException
118118 */
119- public static function check (string $ file , $ ext = null ): void
119+ public static function check (string $ file , $ ext = null )
120120 {
121121 if (!$ file || !file_exists ($ file )) {
122122 throw new FileNotFoundException ("File {$ file } not exists! " );
@@ -142,7 +142,7 @@ public static function check(string $file, $ext = null): void
142142 * @throws IOException When target file or directory already exists
143143 * @throws IOException When origin cannot be renamed
144144 */
145- public static function rename (string $ origin , string $ target , bool $ overwrite = false ): void
145+ public static function rename (string $ origin , string $ target , bool $ overwrite = false )
146146 {
147147 // we check that target does not exist
148148 if (!$ overwrite && static ::isReadable ($ target )) {
@@ -176,7 +176,7 @@ public static function isReadable(string $filename): bool
176176 * @param int $mode The directory mode
177177 * @throws IOException On any directory creation failure
178178 */
179- public static function mkdir ($ dirs , $ mode = 0777 ): void
179+ public static function mkdir ($ dirs , $ mode = 0777 )
180180 {
181181 foreach (Arr::toIterator ($ dirs ) as $ dir ) {
182182 if (is_dir ($ dir )) {
@@ -207,7 +207,7 @@ public static function mkdir($dirs, $mode = 0777): void
207207 * @param bool $recursive Whether change the mod recursively or not
208208 * @throws IOException When the change fail
209209 */
210- public static function chmod ($ files , $ mode , $ umask = 0000 , $ recursive = false ): void
210+ public static function chmod ($ files , $ mode , $ umask = 0000 , $ recursive = false )
211211 {
212212 foreach (Arr::toIterator ($ files ) as $ file ) {
213213 if (true !== @chmod ($ file , $ mode & ~$ umask )) {
@@ -228,7 +228,7 @@ public static function chmod($files, $mode, $umask = 0000, $recursive = false):
228228 * @param bool $recursive Whether change the owner recursively or not
229229 * @throws IOException When the change fail
230230 */
231- public static function chown ($ files , string $ user , $ recursive = false ): void
231+ public static function chown ($ files , string $ user , $ recursive = false )
232232 {
233233 foreach (Arr::toIterator ($ files ) as $ file ) {
234234 if ($ recursive && is_dir ($ file ) && !is_link ($ file )) {
@@ -251,11 +251,12 @@ public static function chown($files, string $user, $recursive = false): void
251251 * @param string $srcDir
252252 * @param callable $filter
253253 * @return \RecursiveIteratorIterator
254+ * @throws \InvalidArgumentException
254255 */
255256 public static function getIterator (string $ srcDir , callable $ filter ): \RecursiveIteratorIterator
256257 {
257258 if (!$ srcDir || !file_exists ($ srcDir )) {
258- throw new \LogicException ('Please provide a exists source directory. ' );
259+ throw new \InvalidArgumentException ('Please provide a exists source directory. ' );
259260 }
260261
261262 $ directory = new \RecursiveDirectoryIterator ($ srcDir );
0 commit comments