mirror of
https://github.com/bitinflow/bunny-cli.git
synced 2026-03-13 21:55:54 +00:00
first commit
This commit is contained in:
32
app/Bunny/Filesystem/LocalFile.php
Normal file
32
app/Bunny/Filesystem/LocalFile.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Bunny\Filesystem;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class LocalFile implements File
|
||||
{
|
||||
private string $filename;
|
||||
private ?string $checksum;
|
||||
|
||||
public function __construct(string $filename, ?string $checksum)
|
||||
{
|
||||
$this->filename = $filename;
|
||||
$this->checksum = $checksum;
|
||||
}
|
||||
|
||||
public function getFilename($search = '', $replace = ''): string
|
||||
{
|
||||
return Str::replaceFirst($search, $replace, $this->filename);
|
||||
}
|
||||
|
||||
public function getChecksum(): string
|
||||
{
|
||||
return $this->checksum;
|
||||
}
|
||||
|
||||
public function isDirectory(): bool
|
||||
{
|
||||
return $this->checksum == null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user