InvalidPackageException.php 1001 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /*
  3. * This file is part of Composer.
  4. *
  5. * (c) Nils Adermann <naderman@naderman.de>
  6. * Jordi Boggiano <j.boggiano@seld.be>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Composer\Package\Loader;
  12. /**
  13. * @author Jordi Boggiano <j.boggiano@seld.be>
  14. */
  15. class InvalidPackageException extends \Exception
  16. {
  17. private $errors;
  18. private $warnings;
  19. private $data;
  20. public function __construct(array $errors, array $warnings, array $data)
  21. {
  22. $this->errors = $errors;
  23. $this->warnings = $warnings;
  24. $this->data = $data;
  25. parent::__construct("Invalid package information: \n".implode("\n", array_merge($errors, $warnings)));
  26. }
  27. public function getData()
  28. {
  29. return $this->data;
  30. }
  31. public function getErrors()
  32. {
  33. return $this->errors;
  34. }
  35. public function getWarnings()
  36. {
  37. return $this->warnings;
  38. }
  39. }