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

brick / geo / 13716844819

07 Mar 2025 08:35AM UTC coverage: 47.964% (+3.9%) from 44.086%
13716844819

push

github

BenMorel
Add TypeChecker for engines

8 of 21 new or added lines in 5 files covered. (38.1%)

98 existing lines in 18 files now uncovered.

1684 of 3511 relevant lines covered (47.96%)

944.32 hits per line

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

91.67
/src/IO/EWKTParser.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Brick\Geo\IO;
6

7
use Override;
8

9
/**
10
 * Parser for the Extended WKT format designed by PostGIS.
11
 *
12
 * @internal
13
 */
14
final class EWKTParser extends WKTParser
15
{
16
    protected const T_SRID = 1;
17
    protected const T_WORD = 2;
18
    protected const T_NUMBER = 3;
19

20
    protected const REGEX_SRID = 'SRID\=([0-9]+)\s*;';
21

22
    #[Override]
23
    protected function getRegex() : array
24
    {
25
        return [
4,760✔
26
            self::T_SRID   => self::REGEX_SRID,
4,760✔
27
            self::T_WORD   => self::REGEX_WORD,
4,760✔
28
            self::T_NUMBER => self::REGEX_NUMBER,
4,760✔
29
        ];
4,760✔
30
    }
31

32
    public function getOptionalSRID() : int
33
    {
34
        $token = $this->tokens[$this->current] ?? null;
4,760✔
35

36
        if ($token === null) {
4,760✔
UNCOV
37
            return 0;
×
38
        }
39

40
        if ($token[0] !== self::T_SRID) {
4,760✔
41
            return 0;
2,380✔
42
        }
43

44
        $this->current++;
2,380✔
45

46
        return (int) $token[1];
2,380✔
47
    }
48
}
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