• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

brick / geo / 13632627167

03 Mar 2025 01:58PM UTC coverage: 47.859% (+0.3%) from 47.546%
13632627167

push

github

BenMorel
Final methods in abstract test classes

1632 of 3410 relevant lines covered (47.86%)

965.73 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

47.37
/src/Exception/GeometryIOException.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Brick\Geo\Exception;
6

7
use JsonException;
8

9
/**
10
 * Exception thrown when an error occurs reading or writing WKT/WKB representations.
11
 */
12
class GeometryIOException extends GeometryException
13
{
14
    public static function invalidWKB(string $message) : GeometryIOException
15
    {
16
        return new self('Invalid WKB: ' . $message);
×
17
    }
18

19
    public static function invalidWKT() : GeometryIOException
20
    {
21
        return new self('Invalid WKT.');
×
22
    }
23

24
    public static function invalidEWKT() : GeometryIOException
25
    {
26
        return new self('Invalid EWKT.');
×
27
    }
28

29
    public static function invalidGeoJSON(string $context, ?JsonException $e = null) : GeometryIOException
30
    {
31
        $message = sprintf('Invalid GeoJSON: %s', $context);
21✔
32

33
        return new self($message, 0, $e);
21✔
34
    }
35

36
    public static function unsupportedWKBType(int $wkbType) : GeometryIOException
37
    {
38
        $message = sprintf('Unsupported WKB type: %d.', $wkbType);
×
39

40
        return new self($message);
×
41
    }
42

43
    public static function unsupportedGeoJSONType(string $geojsonType) : GeometryIOException
44
    {
45
        $message = sprintf('Unsupported GeoJSON type: %s.', $geojsonType);
×
46

47
        return new self($message);
×
48
    }
49

50
    public static function unsupportedGeoJSONTypeWrongCase(string $wrongCase, string $correctCase) : GeometryIOException
51
    {
52
        $message = sprintf(
217✔
53
            'Unsupported GeoJSON type: %s. The correct case is %s. ' .
217✔
54
            'You can allow incorrect cases by setting the $lenient flag to true.',
217✔
55
            $wrongCase,
217✔
56
            $correctCase,
217✔
57
        );
217✔
58

59
        return new self($message);
217✔
60
    }
61

62
    public static function unsupportedGeometryType(string $geometryType) : GeometryIOException
63
    {
64
        $message = sprintf('Unsupported geometry type: %s.', $geometryType);
×
65

66
        return new self($message);
×
67
    }
68

69
    public static function unsupportedEndianness() : GeometryIOException
70
    {
71
        return new self('This platform has an unsupported endianness.');
×
72
    }
73
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc