Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
namespace League\Flysystem;
6
 
7
use RuntimeException;
8
use Throwable;
9
 
10
final class UnableToDeleteFile extends RuntimeException implements FilesystemOperationFailed
11
{
12
    /**
13
     * @var string
14
     */
15
    private $location = '';
16
 
17
    /**
18
     * @var string
19
     */
20
    private $reason;
21
 
22
    public static function atLocation(string $location, string $reason = '', Throwable $previous = null): UnableToDeleteFile
23
    {
24
        $e = new static(rtrim("Unable to delete file located at: {$location}. {$reason}"), 0, $previous);
25
        $e->location = $location;
26
        $e->reason = $reason;
27
 
28
        return $e;
29
    }
30
 
31
    public function operation(): string
32
    {
33
        return FilesystemOperationFailed::OPERATION_DELETE;
34
    }
35
 
36
    public function reason(): string
37
    {
38
        return $this->reason;
39
    }
40
 
41
    public function location(): string
42
    {
43
        return $this->location;
44
    }
45
}