Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php declare(strict_types = 1);
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
namespace PharIo\Manifest;
11
 
12
use LibXMLError;
13
 
14
class ManifestDocumentLoadingException extends \Exception implements Exception {
15
    /** @var LibXMLError[] */
16
    private $libxmlErrors;
17
 
18
    /**
19
     * ManifestDocumentLoadingException constructor.
20
     *
21
     * @param LibXMLError[] $libxmlErrors
22
     */
23
    public function __construct(array $libxmlErrors) {
24
        $this->libxmlErrors = $libxmlErrors;
25
        $first              = $this->libxmlErrors[0];
26
 
27
        parent::__construct(
28
            \sprintf(
29
                '%s (Line: %d / Column: %d / File: %s)',
30
                $first->message,
31
                $first->line,
32
                $first->column,
33
                $first->file
34
            ),
35
            $first->code
36
        );
37
    }
38
 
39
    /**
40
     * @return LibXMLError[]
41
     */
42
    public function getLibxmlErrors(): array {
43
        return $this->libxmlErrors;
44
    }
45
}