vendor/league/flysystem/src/UnableToRetrieveMetadata.php line 44

  1. <?php
  2. declare(strict_types=1);
  3. namespace League\Flysystem;
  4. use RuntimeException;
  5. use Throwable;
  6. final class UnableToRetrieveMetadata extends RuntimeException implements FilesystemOperationFailed
  7. {
  8.     /**
  9.      * @var string
  10.      */
  11.     private $location;
  12.     /**
  13.      * @var string
  14.      */
  15.     private $metadataType;
  16.     /**
  17.      * @var string
  18.      */
  19.     private $reason;
  20.     public static function lastModified(string $locationstring $reason ''Throwable $previous null): self
  21.     {
  22.         return static::create($locationFileAttributes::ATTRIBUTE_LAST_MODIFIED$reason$previous);
  23.     }
  24.     public static function visibility(string $locationstring $reason ''Throwable $previous null): self
  25.     {
  26.         return static::create($locationFileAttributes::ATTRIBUTE_VISIBILITY$reason$previous);
  27.     }
  28.     public static function fileSize(string $locationstring $reason ''Throwable $previous null): self
  29.     {
  30.         return static::create($locationFileAttributes::ATTRIBUTE_FILE_SIZE$reason$previous);
  31.     }
  32.     public static function mimeType(string $locationstring $reason ''Throwable $previous null): self
  33.     {
  34.         return static::create($locationFileAttributes::ATTRIBUTE_MIME_TYPE$reason$previous);
  35.     }
  36.     public static function create(string $locationstring $typestring $reason ''Throwable $previous null): self
  37.     {
  38.         $e = new static("Unable to retrieve the $type for file at location: $location{$reason}"0$previous);
  39.         $e->reason $reason;
  40.         $e->location $location;
  41.         $e->metadataType $type;
  42.         return $e;
  43.     }
  44.     public function reason(): string
  45.     {
  46.         return $this->reason;
  47.     }
  48.     public function location(): string
  49.     {
  50.         return $this->location;
  51.     }
  52.     public function metadataType(): string
  53.     {
  54.         return $this->metadataType;
  55.     }
  56.     public function operation(): string
  57.     {
  58.         return FilesystemOperationFailed::OPERATION_RETRIEVE_METADATA;
  59.     }
  60. }