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

brick / geo / 17456208570

04 Sep 2025 07:10AM UTC coverage: 50.432%. Remained the same
17456208570

push

github

BenMorel
Use @extends and @implements instead of @template-* variants

For consistency with the rest of the project.

1867 of 3702 relevant lines covered (50.43%)

1140.21 hits per line

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

79.17
/src/Exception/CoordinateSystemException.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Brick\Geo\Exception;
6

7
use Brick\Geo\CoordinateSystem;
8
use Brick\Geo\Geometry;
9

10
use function sprintf;
11

12
/**
13
 * Exception thrown when coordinate systems are mixed.
14
 */
15
final class CoordinateSystemException extends GeometryException
16
{
17
    public static function sridMix(int $srid1, int $srid2): CoordinateSystemException
18
    {
19
        return new CoordinateSystemException(sprintf(
×
20
            'SRID mix: cannot mix SRID %d with SRID %d.',
×
21
            $srid1,
×
22
            $srid2,
×
23
        ));
×
24
    }
25

26
    public static function sridCompositionMix(Geometry $reference, Geometry $culprit): CoordinateSystemException
27
    {
28
        return new CoordinateSystemException(sprintf(
48✔
29
            'SRID mix: %s with SRID %d cannot contain %s with SRID %d.',
48✔
30
            $reference->geometryType(),
48✔
31
            $reference->srid(),
48✔
32
            $culprit->geometryType(),
48✔
33
            $culprit->srid(),
48✔
34
        ));
48✔
35
    }
36

37
    public static function dimensionalityMix(CoordinateSystem $a, CoordinateSystem $b): CoordinateSystemException
38
    {
39
        return new CoordinateSystemException(sprintf(
48✔
40
            'Dimensionality mix: cannot mix %s with %s.',
48✔
41
            $a->coordinateName(),
48✔
42
            $b->coordinateName(),
48✔
43
        ));
48✔
44
    }
45

46
    public static function dimensionalityCompositionMix(Geometry $reference, Geometry $culprit): CoordinateSystemException
47
    {
48
        return new CoordinateSystemException(sprintf(
144✔
49
            'Dimensionality mix: %s %s cannot contain %s %s.',
144✔
50
            $reference->geometryType(),
144✔
51
            $reference->coordinateSystem()->coordinateName(),
144✔
52
            $culprit->geometryType(),
144✔
53
            $culprit->coordinateSystem()->coordinateName(),
144✔
54
        ));
144✔
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