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

brick / geo / 14087467812

26 Mar 2025 03:39PM UTC coverage: 63.783%. Remained the same
14087467812

push

github

BenMorel
Test with all 3 PDO errmodes

1939 of 3040 relevant lines covered (63.78%)

2122.25 hits per line

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

57.14
/src/Exception/GeometryEngineException.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Brick\Geo\Exception;
6

7
use Brick\Geo\Geometry;
8

9
/**
10
 * Exception thrown by geometry engines.
11
 *
12
 * This exception is notably thrown when a specific method is not implemented by a geometry engine.
13
 */
14
final class GeometryEngineException extends GeometryException
15
{
16
    public static function wrap(\Exception $e) : GeometryEngineException
17
    {
18
        return new self('The engine returned an exception: ' . $e->getMessage(), $e);
458✔
19
    }
20

21
    public static function unimplementedMethod(string $methodName) : GeometryEngineException
22
    {
23
        $message = sprintf('%s() is currently not implemented.', $methodName);
221✔
24

25
        return new self($message);
221✔
26
    }
27

28
    public static function operationYieldedNoResult() : GeometryEngineException
29
    {
30
        return new self('This operation yielded no result on the target database.');
×
31
    }
32

33
    public static function unexpectedDatabaseReturnType(string $expectedType, mixed $actualValue) : GeometryEngineException
34
    {
35
        return new self(sprintf(
140✔
36
            'The database returned an unexpected type: expected %s, got %s.',
140✔
37
            $expectedType,
140✔
38
            get_debug_type($actualValue),
140✔
39
        ));
140✔
40
    }
41

42
    /**
43
     * @param class-string<Geometry> $expectedClassName
44
     * @param class-string<Geometry> $actualClassName
45
     */
46
    public static function unexpectedReturnType(
47
        string $expectedClassName,
48
        string $actualClassName,
49
    ) : GeometryEngineException {
50
        return new self(sprintf(
×
51
            'The geometry engine returned an unexpected type: expected %s, got %s.',
×
52
            $expectedClassName,
×
53
            $actualClassName,
×
54
        ));
×
55
    }
56
}
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