Drupal investigation

AdapterFailureException.php 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Finder\Exception;
  11. @trigger_error('The '.__NAMESPACE__.'\AdapterFailureException class is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
  12. use Symfony\Component\Finder\Adapter\AdapterInterface;
  13. /**
  14. * Base exception for all adapter failures.
  15. *
  16. * @author Jean-François Simon <contact@jfsimon.fr>
  17. *
  18. * @deprecated since 2.8, to be removed in 3.0.
  19. */
  20. class AdapterFailureException extends \RuntimeException implements ExceptionInterface
  21. {
  22. /**
  23. * @var \Symfony\Component\Finder\Adapter\AdapterInterface
  24. */
  25. private $adapter;
  26. /**
  27. * @param AdapterInterface $adapter
  28. * @param string|null $message
  29. * @param \Exception|null $previous
  30. */
  31. public function __construct(AdapterInterface $adapter, $message = null, \Exception $previous = null)
  32. {
  33. $this->adapter = $adapter;
  34. parent::__construct($message ?: 'Search failed with "'.$adapter->getName().'" adapter.', $previous);
  35. }
  36. /**
  37. * {@inheritdoc}
  38. */
  39. public function getAdapter()
  40. {
  41. return $this->adapter;
  42. }
  43. }