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

ipublikuj / doctrine-crud / 10244968780

05 Aug 2024 08:03AM UTC coverage: 31.907% (-22.9%) from 54.777%
10244968780

push

github

web-flow
Merge pull request #8 from ipublikuj/feature/throw-exception

Throw dbal exception

0 of 2 new or added lines in 2 files covered. (0.0%)

277 existing lines in 8 files now uncovered.

164 of 514 relevant lines covered (31.91%)

2.13 hits per line

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

0.0
/src/StringFunctions/DateFormat.php
1
<?php declare(strict_types = 1);
2

3
/**
4
 * DateFormat.php
5
 *
6
 * @copyright      More in LICENSE.md
7
 * @license        https://www.ipublikuj.eu
8
 * @author         Adam Kadlec <adam.kadlec@ipublikuj.eu>
9
 * @package        iPublikuj:DoctrineCrud!
10
 * @subpackage     String functions
11
 * @since          1.0.0
12
 *
13
 * @date           29.01.14
14
 */
15

16
namespace IPub\DoctrineCrud\StringFunctions;
17

18
use Doctrine\ORM\Query;
19

20
class DateFormat extends Query\AST\Functions\FunctionNode
21
{
22

23
        /**
24
         * Holds the timestamp of the DATE_FORMAT DQL statement
25
         */
26
        protected Query\AST\ArithmeticExpression $dateExpression;
27

28
        /**
29
         * Holds the '%format' parameter of the DATE_FORMAT DQL statement
30
         */
31
        protected string $formatChar;
32

33
        public function getSql(Query\SqlWalker $sqlWalker): string
34
        {
UNCOV
35
                return 'DATE_FORMAT(' .
×
UNCOV
36
                        $sqlWalker->walkArithmeticExpression($this->dateExpression) .
×
UNCOV
37
                        ',' .
×
UNCOV
38
                        $sqlWalker->walkStringPrimary($this->formatChar) .
×
UNCOV
39
                        ')';
×
40
        }
41

42
        /**
43
         * @throws Query\QueryException
44
         */
45
        public function parse(Query\Parser $parser): void
46
        {
UNCOV
47
                $parser->match(Query\TokenType::T_IDENTIFIER);
×
UNCOV
48
                $parser->match(Query\TokenType::T_OPEN_PARENTHESIS);
×
49

UNCOV
50
                $this->dateExpression = $parser->ArithmeticExpression();
×
UNCOV
51
                $parser->match(Query\TokenType::T_COMMA);
×
52

UNCOV
53
                $this->formatChar = (string) $parser->StringPrimary();
×
UNCOV
54
                $parser->match(Query\TokenType::T_CLOSE_PARENTHESIS);
×
55
        }
56

57
}
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