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

brick / geo / 13643010879

04 Mar 2025 12:00AM UTC coverage: 84.402% (-0.004%) from 84.406%
13643010879

push

github

BenMorel
Restore the PDO error mode in case of an exception

1 of 1 new or added line in 1 file covered. (100.0%)

79 existing lines in 5 files now uncovered.

1553 of 1840 relevant lines covered (84.4%)

1983.41 hits per line

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

0.0
/src/Projector/SwapXYProjector.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Brick\Geo\Projector;
6

7
use Brick\Geo\CoordinateSystem;
8
use Brick\Geo\Point;
9
use Override;
10

11
/**
12
 * Swaps the X and Y coordinates of a Geometry, while keeping the same SRID.
13
 */
14
final class SwapXYProjector implements Projector
15
{
16
    #[Override]
17
    public function project(Point $point): Point
18
    {
19
        if ($point->isEmpty()) {
×
20
            return $point;
×
21
        }
22

23
        $coordinates = $point->toArray();
×
24

25
        /** @psalm-suppress PossiblyUndefinedArrayOffset */
UNCOV
26
        [$x, $y] = $coordinates;
×
27

28
        $coordinates[0] = $y;
×
UNCOV
29
        $coordinates[1] = $x;
×
30

UNCOV
31
        return new Point($point->coordinateSystem(), ...$coordinates);
×
32
    }
33

34
    #[Override]
35
    public function getTargetCoordinateSystem(CoordinateSystem $sourceCoordinateSystem): CoordinateSystem
36
    {
UNCOV
37
        return $sourceCoordinateSystem;
×
38
    }
39
}
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