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
 
9
use Throwable;
10
 
11
use function rtrim;
12
 
13
final class UnableToSetVisibility extends RuntimeException implements FilesystemOperationFailed
14
{
15
    /**
16
     * @var string
17
     */
18
    private $location;
19
 
20
    /**
21
     * @var string
22
     */
23
    private $reason;
24
 
25
    public function reason(): string
26
    {
27
        return $this->reason;
28
    }
29
 
30
    public static function atLocation(string $filename, string $extraMessage = '', Throwable $previous = null): self
31
    {
32
        $message = "Unable to set visibility for file {$filename}. $extraMessage";
33
        $e = new static(rtrim($message), 0, $previous);
34
        $e->reason = $extraMessage;
35
        $e->location = $filename;
36
 
37
        return $e;
38
    }
39
 
40
    public function operation(): string
41
    {
42
        return FilesystemOperationFailed::OPERATION_SET_VISIBILITY;
43
    }
44
 
45
    public function location(): string
46
    {
47
        return $this->location;
48
    }
49
}