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

brick / geo / 14062713921

25 Mar 2025 02:49PM UTC coverage: 62.13% (+0.2%) from 61.936%
14062713921

push

github

BenMorel
Implement PgsqlDriver (pgsql extension)

0 of 52 new or added lines in 1 file covered. (0.0%)

59 existing lines in 8 files now uncovered.

1890 of 3042 relevant lines covered (62.13%)

1687.76 hits per line

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

75.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 readonly class SwapXyProjector implements Projector
15
{
16
    #[Override]
17
    public function project(Point $point): Point
18
    {
UNCOV
19
        if ($point->isEmpty()) {
14✔
20
            return $point;
×
21
        }
22

UNCOV
23
        $coordinates = $point->toArray();
14✔
24

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

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

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

34
    #[Override]
35
    public function getTargetCoordinateSystem(CoordinateSystem $sourceCoordinateSystem): CoordinateSystem
36
    {
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