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

brick / geo / 13642551372

03 Mar 2025 11:25PM UTC coverage: 84.406% (+0.8%) from 83.61%
13642551372

push

github

BenMorel
Merge WKTParser & EWKTParser

31 of 32 new or added lines in 3 files covered. (96.88%)

69 existing lines in 8 files now uncovered.

1548 of 1834 relevant lines covered (84.41%)

1988.83 hits per line

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

87.5
/src/Triangle.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Brick\Geo;
6

7
use Brick\Geo\Exception\InvalidGeometryException;
8
use Brick\Geo\Projector\Projector;
9
use Override;
10

11
/**
12
 * A Triangle is a Polygon with 3 distinct, non-collinear vertices and no interior boundary.
13
 */
14
final class Triangle extends Polygon
15
{
16
    #[Override]
17
    protected function validate(): void
18
    {
19
        if ($this->isEmpty) {
1,316✔
UNCOV
20
            return;
×
21
        }
22

23
        if ($this->exteriorRing()->numPoints() !== 4) {
1,316✔
24
            throw new InvalidGeometryException('A Triangle must have exactly 4 (3 + first again) points.');
7✔
25
        }
26

27
        if ($this->numInteriorRings() !== 0) {
1,309✔
28
            throw new InvalidGeometryException('A Triangle must not have interior rings.');
7✔
29
        }
30
    }
31

32
    #[Override]
33
    public function geometryType() : string
34
    {
35
        return 'Triangle';
707✔
36
    }
37

38
    #[Override]
39
    public function geometryTypeBinary() : int
40
    {
41
        return Geometry::TRIANGLE;
504✔
42
    }
43
}
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