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

jsor / doctrine-postgis / 4647733370

pending completion
4647733370

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

90.48
/src/Functions/ST_AsGeoJSON.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_AsGeoJSON extends FunctionNode
16
{
17
    protected array $expressions = [];
18

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

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

26
        $lexer = $parser->getLexer();
2✔
27

28
        /** @psalm-suppress DeprecatedMethod */
29
        $nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;
2✔
30

31
        if (Lexer::T_COMMA === $nextType) {
2✔
32
            $parser->match(Lexer::T_COMMA);
1✔
33
            $this->expressions[] = $parser->ArithmeticFactor();
1✔
34
        }
35

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

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

44
        /** @psalm-suppress DeprecatedMethod */
45
        $nextType = $lexer->lookahead['type'] ?? $lexer->lookahead->type ?? null;
2✔
46

47
        if (Lexer::T_COMMA === $nextType) {
2✔
48
            $parser->match(Lexer::T_COMMA);
×
49
            $this->expressions[] = $parser->ArithmeticFactor();
×
50
        }
51

52
        $parser->match(Lexer::T_CLOSE_PARENTHESIS);
2✔
53
    }
54

55
    public function getSql(SqlWalker $sqlWalker): string
56
    {
57
        $arguments = [];
2✔
58

59
        /** @var Node $expression */
60
        foreach ($this->expressions as $expression) {
2✔
61
            $arguments[] = $expression->dispatch($sqlWalker);
2✔
62
        }
63

64
        return 'ST_AsGeoJSON(' . implode(', ', $arguments) . ')';
2✔
65
    }
66
}
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