11<?php
22
3- /*
4- * This file is part of the aether/aether.
5- *
6- * Copyright (C) 2024 Dominik Szamburski
7- *
8- * This software may be modified and distributed under the terms
9- * of the MIT license. See the LICENSE file for details.
10- */
11-
12- namespace Aether \Filesystem ;
13-
14- interface FilesystemInterface
3+ namespace Aether \Contracts \Filesystem ;
4+
5+ interface Filesystem
156{
167 /**
178 * Checks if a file exists at the given path.
189 *
1910 * @param string $path
2011 * @return bool
21- * @throws \Aether\Filesystem\IOException
12+ * @throws \Aether\Contracts\ Filesystem\IOException
2213 */
2314 public function exists (string $ path ): bool ;
2415
@@ -37,7 +28,7 @@ public function read(string $path): string;
3728 * @param string $contents
3829 * @param bool $lock
3930 * @return void
40- * @throws \Aether\Filesystem\IOException
31+ * @throws \Aether\Contracts\ Filesystem\IOException
4132 */
4233 public function write (string $ path , string $ contents , bool $ lock = false ): void ;
4334
@@ -46,10 +37,9 @@ public function write(string $path, string $contents, bool $lock = false): void;
4637 *
4738 * @param string $source
4839 * @param string $destination
49-
50- * @return void
40+ * @return void
5141 *
52- * @throws \Aether\Filesystem\IOException
42+ * @throws \Aether\Contracts\ Filesystem\IOException
5343 */
5444 public function copy (string $ source , string $ destination ): void ;
5545
@@ -61,7 +51,7 @@ public function copy(string $source, string $destination): void;
6151 *
6252 * @return void
6353 *
64- * @throws \Aether\Filesystem\IOException
54+ * @throws \Aether\Contracts\ Filesystem\IOException
6555 */
6656 public function move (string $ source , string $ destination ): void ;
6757
@@ -86,10 +76,10 @@ public function touch(string $filename, ?int $mtime = null, ?int $atime = null):
8676 /**
8777 * Deletes a file.
8878 *
89- * @param string|array $filename
79+ * @param string|string[] $filename
9080 * @return void
9181 *
92- * @throws \Aether\Filesystem\IOException
82+ * @throws \Aether\Contracts\ Filesystem\IOException
9383 */
9484 public function unlink (string |array $ filename ): void ;
9585
@@ -102,7 +92,7 @@ public function unlink(string|array $filename): void;
10292 *
10393 * @return void
10494 *
105- * @throws \Aether\Filesystem\IOException
95+ * @throws \Aether\Contracts\ Filesystem\IOException
10696 */
10797 public function mkdir (string $ directory , int $ mode = 0777 , bool $ recursive = true ): void ;
10898
@@ -112,7 +102,7 @@ public function mkdir(string $directory, int $mode = 0777, bool $recursive = tru
112102 * @param string $directory
113103 * @return void
114104 *
115- * @throws \Aether\Filesystem\IOException
105+ * @throws \Aether\Contracts\ Filesystem\IOException
116106 */
117107 public function rmdir (string $ directory ): void ;
118108
@@ -154,7 +144,7 @@ public function extension(string $path): string;
154144 * @param string $path
155145 * @return int
156146 *
157- * @throws \Aether\Filesystem\IOException
147+ * @throws \Aether\Contracts\ Filesystem\IOException
158148 */
159149 public function filesize (string $ path ): int ;
160150
@@ -180,7 +170,7 @@ public function isFile(string $path): bool;
180170 * @param string $path
181171 * @return string
182172 *
183- * @throws \Aether\Filesystem\IOException
173+ * @throws \Aether\Contracts\ Filesystem\IOException
184174 */
185175 public function mimeType (string $ path ): string ;
186176}
0 commit comments