Просмотр файла vendor/nelexa/zip/src/Exception/ZipEntryNotFoundException.php

Размер файла: 808B
  1. <?php
  2.  
  3. namespace PhpZip\Exception;
  4.  
  5. use PhpZip\Model\ZipEntry;
  6.  
  7. /**
  8. * Thrown if entry not found.
  9. *
  10. * @author Ne-Lexa alexey@nelexa.ru
  11. * @license MIT
  12. */
  13. class ZipEntryNotFoundException extends ZipException
  14. {
  15. /** @var string */
  16. private $entryName;
  17.  
  18. /**
  19. * ZipEntryNotFoundException constructor.
  20. *
  21. * @param ZipEntry|string $entryName
  22. */
  23. public function __construct($entryName)
  24. {
  25. $entryName = $entryName instanceof ZipEntry ? $entryName->getName() : $entryName;
  26. parent::__construct(sprintf(
  27. 'Zip Entry "%s" was not found in the archive.',
  28. $entryName
  29. ));
  30. $this->entryName = $entryName;
  31. }
  32.  
  33. /**
  34. * @return string
  35. */
  36. public function getEntryName()
  37. {
  38. return $this->entryName;
  39. }
  40. }