comparison vendor/phar-io/manifest/src/xml/ManifestDocumentLoadingException.php @ 2:5311817fb629

Theme updates
author Chris Cannam
date Tue, 10 Jul 2018 13:19:18 +0000
parents
children
comparison
equal deleted inserted replaced
1:0b0e5f3b1e83 2:5311817fb629
1 <?php
2 /*
3 * This file is part of PharIo\Manifest.
4 *
5 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
6 *
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
10
11 namespace PharIo\Manifest;
12
13 use LibXMLError;
14
15 class ManifestDocumentLoadingException extends \Exception implements Exception {
16 /**
17 * @var LibXMLError[]
18 */
19 private $libxmlErrors;
20
21 /**
22 * ManifestDocumentLoadingException constructor.
23 *
24 * @param LibXMLError[] $libxmlErrors
25 */
26 public function __construct(array $libxmlErrors) {
27 $this->libxmlErrors = $libxmlErrors;
28 $first = $this->libxmlErrors[0];
29
30 parent::__construct(
31 sprintf(
32 '%s (Line: %d / Column: %d / File: %s)',
33 $first->message,
34 $first->line,
35 $first->column,
36 $first->file
37 ),
38 $first->code
39 );
40 }
41
42 /**
43 * @return LibXMLError[]
44 */
45 public function getLibxmlErrors() {
46 return $this->libxmlErrors;
47 }
48 }