Skip to content

Commit e45e501

Browse files
committed
use types
1 parent 8f09461 commit e45e501

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/Filesystem.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,11 @@ public function has(string $filename): bool
2626
return file_exists($this->path($filename));
2727
}
2828

29-
/**
29+
/*
3030
* Get all file names in this directory that have the same name
3131
* as $fileName, but have a different file extension.
32-
*
33-
* @param string $fileName
34-
*
35-
* @return array
3632
*/
37-
public function getNamesWithDifferentExtension(string $fileName)
33+
public function getNamesWithDifferentExtension(string $fileName): array
3834
{
3935
if (! file_exists($this->basePath)) {
4036
return [];
@@ -62,7 +58,7 @@ public function read(string $filename): string
6258
return file_get_contents($this->path($filename));
6359
}
6460

65-
public function put(string $filename, string $contents)
61+
public function put(string $filename, string $contents): void
6662
{
6763
if (! file_exists($this->basePath)) {
6864
mkdir($this->basePath, 0777, true);
@@ -71,12 +67,12 @@ public function put(string $filename, string $contents)
7167
file_put_contents($this->path($filename), $contents);
7268
}
7369

74-
public function delete(string $fileName)
70+
public function delete(string $fileName): bool
7571
{
7672
return unlink($this->path($fileName));
7773
}
7874

79-
public function copy(string $filePath, string $fileName)
75+
public function copy(string $filePath, string $fileName): void
8076
{
8177
if (! file_exists($this->basePath)) {
8278
mkdir($this->basePath, 0777, true);
@@ -85,7 +81,7 @@ public function copy(string $filePath, string $fileName)
8581
copy($filePath, $this->path($fileName));
8682
}
8783

88-
public function fileEquals(string $filePath, string $fileName)
84+
public function fileEquals(string $filePath, string $fileName): bool
8985
{
9086
return sha1_file($filePath) === sha1_file($this->path($fileName));
9187
}

0 commit comments

Comments
 (0)