Deserializer
6 months ago
Element
6 months ago
Serializer
6 months ago
ContextStackTrait.php
6 months ago
Element.php
6 months ago
LibXMLException.php
6 months ago
ParseException.php
6 months ago
Reader.php
6 months ago
Service.php
6 months ago
Version.php
6 months ago
Writer.php
6 months ago
XmlDeserializable.php
6 months ago
XmlSerializable.php
6 months ago
LibXMLException.php
50 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AmeliaVendor\Sabre\Xml; |
| 6 | |
| 7 | use LibXMLError; |
| 8 | |
| 9 | /** |
| 10 | * This exception is thrown when the Reader runs into a parsing error. |
| 11 | * |
| 12 | * This exception effectively wraps 1 or more LibXMLError objects. |
| 13 | * |
| 14 | * @copyright Copyright (C) 2009-2015 fruux GmbH (https://fruux.com/). |
| 15 | * @author Evert Pot (http://evertpot.com/) |
| 16 | * @license http://sabre.io/license/ Modified BSD License |
| 17 | */ |
| 18 | class LibXMLException extends ParseException |
| 19 | { |
| 20 | /** |
| 21 | * The error list. |
| 22 | * |
| 23 | * @var \LibXMLError[] |
| 24 | */ |
| 25 | protected array $errors; |
| 26 | |
| 27 | /** |
| 28 | * Creates the exception. |
| 29 | * |
| 30 | * You should pass a list of LibXMLError objects in its constructor. |
| 31 | * |
| 32 | * @param \LibXMLError[] $errors |
| 33 | */ |
| 34 | public function __construct(array $errors, int $code = 0, ?\Throwable $previousException = null) |
| 35 | { |
| 36 | $this->errors = $errors; |
| 37 | parent::__construct($errors[0]->message.' on line '.$errors[0]->line.', column '.$errors[0]->column, $code, $previousException); |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Returns the LibXML errors. |
| 42 | * |
| 43 | * @return \LibXMLError[] |
| 44 | */ |
| 45 | public function getErrors(): array |
| 46 | { |
| 47 | return $this->errors; |
| 48 | } |
| 49 | } |
| 50 |