ShellCommandFailureException.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. use Symfony\Component\Finder\Adapter\AdapterInterface;
  12. use Symfony\Component\Finder\Shell\Command;
  13. /**
  14. * @author Jean-François Simon <contact@jfsimon.fr>
  15. */
  16. class ShellCommandFailureException extends AdapterFailureException
  17. {
  18. /**
  19. * @var Command
  20. */
  21. private $command;
  22. /**
  23. * @param AdapterInterface $adapter
  24. * @param Command $command
  25. * @param \Exception|null $previous
  26. */
  27. public function __construct(AdapterInterface $adapter, Command $command, \Exception $previous = null)
  28. {
  29. $this->command = $command;
  30. parent::__construct($adapter, 'Shell command failed: "'.$command->join().'".', $previous);
  31. }
  32. /**
  33. * @return Command
  34. */
  35. public function getCommand()
  36. {
  37. return $this->command;
  38. }
  39. }