From 705c4cb50eea66585cc95c7314001fce9dd197cd Mon Sep 17 00:00:00 2001 From: Stefan Suhren Date: Tue, 5 May 2015 19:34:39 +0200 Subject: Initial commit --- .../Finder/Exception/AccessDeniedException.php | 19 +++++++++ .../Finder/Exception/AdapterFailureException.php | 46 ++++++++++++++++++++++ .../Finder/Exception/ExceptionInterface.php | 23 +++++++++++ .../Exception/OperationNotPermitedException.php | 19 +++++++++ .../Exception/ShellCommandFailureException.php | 45 +++++++++++++++++++++ 5 files changed, 152 insertions(+) create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Exception/AccessDeniedException.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Exception/AdapterFailureException.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Exception/ExceptionInterface.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Exception/OperationNotPermitedException.php create mode 100644 vendor/symfony/finder/Symfony/Component/Finder/Exception/ShellCommandFailureException.php (limited to 'vendor/symfony/finder/Symfony/Component/Finder/Exception') diff --git a/vendor/symfony/finder/Symfony/Component/Finder/Exception/AccessDeniedException.php b/vendor/symfony/finder/Symfony/Component/Finder/Exception/AccessDeniedException.php new file mode 100644 index 0000000..ee195ea --- /dev/null +++ b/vendor/symfony/finder/Symfony/Component/Finder/Exception/AccessDeniedException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Exception; + +/** + * @author Jean-François Simon + */ +class AccessDeniedException extends \UnexpectedValueException +{ +} diff --git a/vendor/symfony/finder/Symfony/Component/Finder/Exception/AdapterFailureException.php b/vendor/symfony/finder/Symfony/Component/Finder/Exception/AdapterFailureException.php new file mode 100644 index 0000000..15fa221 --- /dev/null +++ b/vendor/symfony/finder/Symfony/Component/Finder/Exception/AdapterFailureException.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Exception; + +use Symfony\Component\Finder\Adapter\AdapterInterface; + +/** + * Base exception for all adapter failures. + * + * @author Jean-François Simon + */ +class AdapterFailureException extends \RuntimeException implements ExceptionInterface +{ + /** + * @var \Symfony\Component\Finder\Adapter\AdapterInterface + */ + private $adapter; + + /** + * @param AdapterInterface $adapter + * @param string|null $message + * @param \Exception|null $previous + */ + public function __construct(AdapterInterface $adapter, $message = null, \Exception $previous = null) + { + $this->adapter = $adapter; + parent::__construct($message ?: 'Search failed with "'.$adapter->getName().'" adapter.', $previous); + } + + /** + * {@inheritdoc} + */ + public function getAdapter() + { + return $this->adapter; + } +} diff --git a/vendor/symfony/finder/Symfony/Component/Finder/Exception/ExceptionInterface.php b/vendor/symfony/finder/Symfony/Component/Finder/Exception/ExceptionInterface.php new file mode 100644 index 0000000..bff0214 --- /dev/null +++ b/vendor/symfony/finder/Symfony/Component/Finder/Exception/ExceptionInterface.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Exception; + +/** + * @author Jean-François Simon + */ +interface ExceptionInterface +{ + /** + * @return \Symfony\Component\Finder\Adapter\AdapterInterface + */ + public function getAdapter(); +} diff --git a/vendor/symfony/finder/Symfony/Component/Finder/Exception/OperationNotPermitedException.php b/vendor/symfony/finder/Symfony/Component/Finder/Exception/OperationNotPermitedException.php new file mode 100644 index 0000000..3663112 --- /dev/null +++ b/vendor/symfony/finder/Symfony/Component/Finder/Exception/OperationNotPermitedException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Exception; + +/** + * @author Jean-François Simon + */ +class OperationNotPermitedException extends AdapterFailureException +{ +} diff --git a/vendor/symfony/finder/Symfony/Component/Finder/Exception/ShellCommandFailureException.php b/vendor/symfony/finder/Symfony/Component/Finder/Exception/ShellCommandFailureException.php new file mode 100644 index 0000000..2658f6a --- /dev/null +++ b/vendor/symfony/finder/Symfony/Component/Finder/Exception/ShellCommandFailureException.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Finder\Exception; + +use Symfony\Component\Finder\Adapter\AdapterInterface; +use Symfony\Component\Finder\Shell\Command; + +/** + * @author Jean-François Simon + */ +class ShellCommandFailureException extends AdapterFailureException +{ + /** + * @var Command + */ + private $command; + + /** + * @param AdapterInterface $adapter + * @param Command $command + * @param \Exception|null $previous + */ + public function __construct(AdapterInterface $adapter, Command $command, \Exception $previous = null) + { + $this->command = $command; + parent::__construct($adapter, 'Shell command failed: "'.$command->join().'".', $previous); + } + + /** + * @return Command + */ + public function getCommand() + { + return $this->command; + } +} -- cgit v1.2.3-70-g09d2