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

FluidTYPO3 / vhs / 30001290505

23 Jul 2026 10:57AM UTC coverage: 70.309% (-1.7%) from 72.022%
30001290505

push

github

NamelessCoder
[TER] 8.0.0

4819 of 6854 relevant lines covered (70.31%)

6.54 hits per line

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

63.64
/Classes/Proxy/DoctrineQueryProxy.php
1
<?php
2
namespace FluidTYPO3\Vhs\Proxy;
3

4
/*
5
 * This file is part of the FluidTYPO3/Vhs project under GPLv2 or later.
6
 *
7
 * For the full copyright and license information, please read the
8
 * LICENSE.md file that was distributed with this source code.
9
 */
10

11
use Doctrine\DBAL\Driver\ResultStatement;
12
use Doctrine\DBAL\FetchMode;
13
use Doctrine\DBAL\Result;
14
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
15

16
class DoctrineQueryProxy
17
{
18
    /**
19
     * Returns \Doctrine\DBAL\Result on v11+, \Doctrine\DBAL\Driver\ResultStatement on v10
20
     *
21
     * @return Result|ResultStatement
22
     */
23
    public static function executeQueryOnQueryBuilder(QueryBuilder $queryBuilder)
24
    {
25
        if (method_exists($queryBuilder, 'executeQuery')) {
18✔
26
            return $queryBuilder->executeQuery();
18✔
27
        }
28
        /** @var Result $result */
29
        $result = $queryBuilder->execute();
×
30
        return $result;
×
31
    }
32

33
    /**
34
     * @param Result|ResultStatement $result
35
     */
36
    public static function fetchAssociative($result): ?array
37
    {
38
        if (method_exists($result, 'fetchAssociative')) {
12✔
39
            /** @var array|null $output */
40
            $output = $result->fetchAssociative() ?: null;
12✔
41
        } else {
42
            /** @var array|null $output */
43
            $output = $result->fetch(FetchMode::ASSOCIATIVE);
×
44
        }
45

46
        return $output;
12✔
47
    }
48

49
    /**
50
     * @param Result|ResultStatement $result
51
     */
52
    public static function fetchAllAssociative($result): array
53
    {
54
        if (method_exists($result, 'fetchAllAssociative')) {
6✔
55
            return $result->fetchAllAssociative() ?: [];
6✔
56
        }
57
        return $result->fetchAll(FetchMode::ASSOCIATIVE) ?: [];
×
58
    }
59
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc