Skip to content

Commit d97ab54

Browse files
wouterjnicolas-grekas
authored andcommitted
Add void return types
1 parent 97a0789 commit d97ab54

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

Filesystem.php

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class Filesystem
3333
*
3434
* @throws FileNotFoundException When originFile doesn't exist
3535
* @throws IOException When copy fails
36+
*
37+
* @return void
3638
*/
3739
public function copy(string $originFile, string $targetFile, bool $overwriteNewerFiles = false)
3840
{
@@ -83,6 +85,8 @@ public function copy(string $originFile, string $targetFile, bool $overwriteNewe
8385
* Creates a directory recursively.
8486
*
8587
* @throws IOException On any directory creation failure
88+
*
89+
* @return void
8690
*/
8791
public function mkdir(string|iterable $dirs, int $mode = 0777)
8892
{
@@ -124,6 +128,8 @@ public function exists(string|iterable $files): bool
124128
* @param int|null $atime The access time as a Unix timestamp, if not supplied the current system time is used
125129
*
126130
* @throws IOException When touch fails
131+
*
132+
* @return void
127133
*/
128134
public function touch(string|iterable $files, int $time = null, int $atime = null)
129135
{
@@ -138,6 +144,8 @@ public function touch(string|iterable $files, int $time = null, int $atime = nul
138144
* Removes files or directories.
139145
*
140146
* @throws IOException When removal fails
147+
*
148+
* @return void
141149
*/
142150
public function remove(string|iterable $files)
143151
{
@@ -204,6 +212,8 @@ private static function doRemove(array $files, bool $isRecursive): void
204212
* @param bool $recursive Whether change the mod recursively or not
205213
*
206214
* @throws IOException When the change fails
215+
*
216+
* @return void
207217
*/
208218
public function chmod(string|iterable $files, int $mode, int $umask = 0000, bool $recursive = false)
209219
{
@@ -224,6 +234,8 @@ public function chmod(string|iterable $files, int $mode, int $umask = 0000, bool
224234
* @param bool $recursive Whether change the owner recursively or not
225235
*
226236
* @throws IOException When the change fails
237+
*
238+
* @return void
227239
*/
228240
public function chown(string|iterable $files, string|int $user, bool $recursive = false)
229241
{
@@ -250,6 +262,8 @@ public function chown(string|iterable $files, string|int $user, bool $recursive
250262
* @param bool $recursive Whether change the group recursively or not
251263
*
252264
* @throws IOException When the change fails
265+
*
266+
* @return void
253267
*/
254268
public function chgrp(string|iterable $files, string|int $group, bool $recursive = false)
255269
{
@@ -274,6 +288,8 @@ public function chgrp(string|iterable $files, string|int $group, bool $recursive
274288
*
275289
* @throws IOException When target file or directory already exists
276290
* @throws IOException When origin cannot be renamed
291+
*
292+
* @return void
277293
*/
278294
public function rename(string $origin, string $target, bool $overwrite = false)
279295
{
@@ -314,6 +330,8 @@ private function isReadable(string $filename): bool
314330
* Creates a symbolic link or copy a directory.
315331
*
316332
* @throws IOException When symlink fails
333+
*
334+
* @return void
317335
*/
318336
public function symlink(string $originDir, string $targetDir, bool $copyOnWindows = false)
319337
{
@@ -351,6 +369,8 @@ public function symlink(string $originDir, string $targetDir, bool $copyOnWindow
351369
*
352370
* @throws FileNotFoundException When original file is missing or not a file
353371
* @throws IOException When link fails, including if link already exists
372+
*
373+
* @return void
354374
*/
355375
public function hardlink(string $originFile, string|iterable $targetFiles)
356376
{
@@ -507,6 +527,8 @@ public function makePathRelative(string $endPath, string $startPath): string
507527
* - $options['delete'] Whether to delete files that are not in the source directory (defaults to false)
508528
*
509529
* @throws IOException When file type is unknown
530+
*
531+
* @return void
510532
*/
511533
public function mirror(string $originDir, string $targetDir, \Traversable $iterator = null, array $options = [])
512534
{
@@ -631,6 +653,8 @@ public function tempnam(string $dir, string $prefix, string $suffix = ''): strin
631653
* @param string|resource $content The data to write into the file
632654
*
633655
* @throws IOException if the file cannot be written to
656+
*
657+
* @return void
634658
*/
635659
public function dumpFile(string $filename, $content)
636660
{
@@ -670,6 +694,8 @@ public function dumpFile(string $filename, $content)
670694
* @param bool $lock Whether the file should be locked when writing to it
671695
*
672696
* @throws IOException If the file is not writable
697+
*
698+
* @return void
673699
*/
674700
public function appendToFile(string $filename, $content/* , bool $lock = false */)
675701
{
@@ -728,7 +754,7 @@ private static function box(string $func, mixed ...$args): mixed
728754
/**
729755
* @internal
730756
*/
731-
public static function handleError(int $type, string $msg)
757+
public static function handleError(int $type, string $msg): void
732758
{
733759
self::$lastError = $msg;
734760
}

0 commit comments

Comments
 (0)