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

brick / geo / 14057076899

25 Mar 2025 10:14AM UTC coverage: 52.154% (-13.7%) from 65.828%
14057076899

push

github

BenMorel
Wip

0 of 383 new or added lines in 14 files covered. (0.0%)

141 existing lines in 12 files now uncovered.

1634 of 3133 relevant lines covered (52.15%)

396.62 hits per line

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

21.43
/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
    {
UNCOV
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
    {
NEW
35
        return new self(sprintf(
×
NEW
36
            'The database returned an unexpected type: expected %s, got %s.',
×
NEW
37
            $expectedType,
×
NEW
38
            get_debug_type($actualValue),
×
NEW
39
        ));
×
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 {
UNCOV
50
        return new self(sprintf(
×
UNCOV
51
            'The geometry engine returned an unexpected type: expected %s, got %s.',
×
UNCOV
52
            $expectedClassName,
×
UNCOV
53
            $actualClassName,
×
UNCOV
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