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 UnableToCopyFile extends RuntimeException implements FilesystemOperationFailed
11
{
12
    /**
13
     * @var string
14
     */
15
    private $source;
16
 
17
    /**
18
     * @var string
19
     */
20
    private $destination;
21
 
22
    public function source(): string
23
    {
24
        return $this->source;
25
    }
26
 
27
    public function destination(): string
28
    {
29
        return $this->destination;
30
    }
31
 
32
    public static function fromLocationTo(
33
        string $sourcePath,
34
        string $destinationPath,
35
        Throwable $previous = null
36
    ): UnableToCopyFile {
37
        $e = new static("Unable to copy file from $sourcePath to $destinationPath", 0 , $previous);
38
        $e->source = $sourcePath;
39
        $e->destination = $destinationPath;
40
 
41
        return $e;
42
    }
43
 
44
    public function operation(): string
45
    {
46
        return FilesystemOperationFailed::OPERATION_COPY;
47
    }
48
}