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

brick / geo / 14085752726

26 Mar 2025 02:24PM UTC coverage: 59.868% (-3.9%) from 63.783%
14085752726

push

github

BenMorel
Test pdo_pgsql with emulate prepares ON/OFF

1820 of 3040 relevant lines covered (59.87%)

1055.03 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);
19✔
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(
3✔
36
            'The database returned an unexpected type: expected %s, got %s.',
3✔
37
            $expectedType,
3✔
38
            get_debug_type($actualValue),
3✔
39
        ));
3✔
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