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

FluidTYPO3 / flux / 27757675993

18 Jun 2026 11:55AM UTC coverage: 89.162% (-3.5%) from 92.646%
27757675993

push

github

NamelessCoder
[TASK] Address last phpstan warnings

6228 of 6985 relevant lines covered (89.16%)

40.84 hits per line

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

60.0
/Classes/Utility/DoctrineQueryProxy.php
1
<?php
2
namespace FluidTYPO3\Flux\Utility;
3

4
/*
5
 * This file is part of the FluidTYPO3/Flux 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\FetchMode;
12
use Doctrine\DBAL\Result;
13
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
14

15
class DoctrineQueryProxy
16
{
17
    public static function executeStatementOnQueryBuilder(QueryBuilder $queryBuilder): int
18
    {
19
        if (method_exists($queryBuilder, 'executeStatement')) {
24✔
20
            return $queryBuilder->executeStatement();
24✔
21
        }
22
        /** @var int $result */
23
        $result = $queryBuilder->execute();
×
24
        return $result;
×
25
    }
26

27
    public static function executeQueryOnQueryBuilder(QueryBuilder $queryBuilder): Result
28
    {
29
        if (method_exists($queryBuilder, 'executeQuery')) {
108✔
30
            return $queryBuilder->executeQuery();
108✔
31
        }
32
        /** @var Result $result */
33
        $result = $queryBuilder->execute();
×
34
        return $result;
×
35
    }
36

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

47
        return $output ?: null;
80✔
48
    }
49

50
    public static function fetchAllAssociative(Result $result): array
51
    {
52
        if (method_exists($result, 'fetchAllAssociative')) {
28✔
53
            return $result->fetchAllAssociative() ?: [];
28✔
54
        }
55
        return $result->fetchAll(FetchMode::ASSOCIATIVE) ?: [];
×
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