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

jsor / doctrine-postgis / 4752301553

pending completion
4752301553

push

github

Jan Sorgalla
Use Token::$type directly if available

118 of 118 new or added lines in 48 files covered. (100.0%)

1987 of 2002 relevant lines covered (99.25%)

19.22 hits per line

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

88.24
/src/Functions/ST_DWithin.php
1
<?php
2

3
declare(strict_types=1);
4

5
/* This file is auto-generated. Don't edit directly! */
6

7
namespace Jsor\Doctrine\PostGIS\Functions;
8

9
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
10
use Doctrine\ORM\Query\AST\Node;
11
use Doctrine\ORM\Query\Lexer;
12
use Doctrine\ORM\Query\Parser;
13
use Doctrine\ORM\Query\SqlWalker;
14

15
final class ST_DWithin extends FunctionNode
16
{
17
    protected array $expressions = [];
18

19
    public function parse(Parser $parser): void
20
    {
21
        $parser->match(Lexer::T_IDENTIFIER);
1✔
22
        $parser->match(Lexer::T_OPEN_PARENTHESIS);
1✔
23

24
        $this->expressions[] = $parser->ArithmeticFactor();
1✔
25

26
        $parser->match(Lexer::T_COMMA);
1✔
27

28
        $this->expressions[] = $parser->ArithmeticFactor();
1✔
29

30
        $parser->match(Lexer::T_COMMA);
1✔
31

32
        $this->expressions[] = $parser->ArithmeticFactor();
1✔
33

34
        $lexer = $parser->getLexer();
1✔
35

36
        /** @psalm-suppress DeprecatedMethod */
37
        $nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;
1✔
38

39
        if (Lexer::T_COMMA === $nextType) {
1✔
40
            $parser->match(Lexer::T_COMMA);
×
41
            $this->expressions[] = $parser->ArithmeticFactor();
×
42
        }
43

44
        $parser->match(Lexer::T_CLOSE_PARENTHESIS);
1✔
45
    }
46

47
    public function getSql(SqlWalker $sqlWalker): string
48
    {
49
        $arguments = [];
1✔
50

51
        /** @var Node $expression */
52
        foreach ($this->expressions as $expression) {
1✔
53
            $arguments[] = $expression->dispatch($sqlWalker);
1✔
54
        }
55

56
        return 'ST_DWithin(' . implode(', ', $arguments) . ')';
1✔
57
    }
58
}
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

© 2025 Coveralls, Inc