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

brick / geo / 13861446053

14 Mar 2025 04:52PM UTC coverage: 50.781% (+2.7%) from 48.122%
13861446053

push

github

BenMorel
fixup! Implement GeometryEngine::concaveHull()

1852 of 3647 relevant lines covered (50.78%)

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

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

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

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

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