@@ -26,15 +26,11 @@ public function has(string $filename): bool
26
26
return file_exists ($ this ->path ($ filename ));
27
27
}
28
28
29
- /**
29
+ /*
30
30
* Get all file names in this directory that have the same name
31
31
* as $fileName, but have a different file extension.
32
- *
33
- * @param string $fileName
34
- *
35
- * @return array
36
32
*/
37
- public function getNamesWithDifferentExtension (string $ fileName )
33
+ public function getNamesWithDifferentExtension (string $ fileName ): array
38
34
{
39
35
if (! file_exists ($ this ->basePath )) {
40
36
return [];
@@ -62,7 +58,7 @@ public function read(string $filename): string
62
58
return file_get_contents ($ this ->path ($ filename ));
63
59
}
64
60
65
- public function put (string $ filename , string $ contents )
61
+ public function put (string $ filename , string $ contents ): void
66
62
{
67
63
if (! file_exists ($ this ->basePath )) {
68
64
mkdir ($ this ->basePath , 0777 , true );
@@ -71,12 +67,12 @@ public function put(string $filename, string $contents)
71
67
file_put_contents ($ this ->path ($ filename ), $ contents );
72
68
}
73
69
74
- public function delete (string $ fileName )
70
+ public function delete (string $ fileName ): bool
75
71
{
76
72
return unlink ($ this ->path ($ fileName ));
77
73
}
78
74
79
- public function copy (string $ filePath , string $ fileName )
75
+ public function copy (string $ filePath , string $ fileName ): void
80
76
{
81
77
if (! file_exists ($ this ->basePath )) {
82
78
mkdir ($ this ->basePath , 0777 , true );
@@ -85,7 +81,7 @@ public function copy(string $filePath, string $fileName)
85
81
copy ($ filePath , $ this ->path ($ fileName ));
86
82
}
87
83
88
- public function fileEquals (string $ filePath , string $ fileName )
84
+ public function fileEquals (string $ filePath , string $ fileName ): bool
89
85
{
90
86
return sha1_file ($ filePath ) === sha1_file ($ this ->path ($ fileName ));
91
87
}
0 commit comments