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