-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathKmlParserException.php
More file actions
38 lines (32 loc) · 1.08 KB
/
Copy pathKmlParserException.php
File metadata and controls
38 lines (32 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace PlinCode\KmlParser\Exceptions;
class KmlParserException extends KmlException
{
public static function fileNotFound(string $path): self
{
return new self("KML file not found: {$path}");
}
public static function failedToRead(string $path): self
{
return new self("Unable to read KML file: {$path}");
}
public static function noDataLoaded(): self
{
return new self('No KML data loaded');
}
public static function invalidXml(string $message): self
{
return new self("XML parsing error: {$message}");
}
/**
* @deprecated Nothing throws this any more. Malformed XML now surfaces as
* invalidXml(), and a validation failure keeps its own
* KmlException instead of being wrapped. Kept for one cycle so
* callers referencing it do not break; slated for removal in
* the next major.
*/
public static function failedToParse(string $message): self
{
return new self("Failed to parse KML content: {$message}");
}
}