PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.12.4
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.12.4
3.13.3 3.13.2 3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 All 261 releases
wpfunnels / vendor / league / flysystem / src / UnableToCopyFile.php

UnableToCopyFile.php in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 3.12.4, at vendor/league/flysystem/src/UnableToCopyFile.php

63 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 static function sourceAndDestinationAreTheSame(string $source, string $destination): UnableToCopyFile
45 {
46 return UnableToCopyFile::because('Source and destination are the same', $source, $destination);
47 }
48
49 public static function because(string $reason, string $sourcePath, string $destinationPath): UnableToCopyFile
50 {
51 $e = new static("Unable to copy file from $sourcePath to $destinationPath, because $reason");
52 $e->source = $sourcePath;
53 $e->destination = $destinationPath;
54
55 return $e;
56 }
57
58 public function operation(): string
59 {
60 return FilesystemOperationFailed::OPERATION_COPY;
61 }
62 }
63