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

FluidTYPO3 / flux / 11537652927

25 Oct 2024 01:51PM UTC coverage: 93.245% (-0.02%) from 93.268%
11537652927

push

github

web-flow
[BUGFIX] Correct doctrine proxy when used with non-SELECT statements (#2189)

4 of 6 new or added lines in 2 files covered. (66.67%)

7026 of 7535 relevant lines covered (93.24%)

56.31 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
use Doctrine\DBAL\FetchMode;
5
use Doctrine\DBAL\Result;
6
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
7

8
class DoctrineQueryProxy
9
{
10
    public static function executeStatementOnQueryBuilder(QueryBuilder $queryBuilder): int
11
    {
12
        if (method_exists($queryBuilder, 'executeStatement')) {
36✔
13
            return $queryBuilder->executeStatement();
36✔
14
        }
15
        /** @var int $result */
NEW
16
        $result = $queryBuilder->execute();
×
NEW
17
        return $result;
×
18
    }
19

20
    public static function executeQueryOnQueryBuilder(QueryBuilder $queryBuilder): Result
21
    {
22
        if (method_exists($queryBuilder, 'executeQuery')) {
168✔
23
            return $queryBuilder->executeQuery();
168✔
24
        }
25
        /** @var Result $result */
26
        $result = $queryBuilder->execute();
×
27
        return $result;
×
28
    }
29

30
    public static function fetchAssociative(Result $result): ?array
31
    {
32
        if (method_exists($result, 'fetchAssociative')) {
120✔
33
            /** @var array|null $output */
34
            $output = $result->fetchAssociative() ?: null;
120✔
35
        } else {
36
            /** @var array|null $output */
37
            $output = $result->fetch(FetchMode::ASSOCIATIVE);
×
38
        }
39

40
        return $output;
120✔
41
    }
42

43
    public static function fetchAllAssociative(Result $result): array
44
    {
45
        if (method_exists($result, 'fetchAllAssociative')) {
48✔
46
            return $result->fetchAllAssociative() ?: [];
48✔
47
        }
48
        return $result->fetchAll(FetchMode::ASSOCIATIVE) ?: [];
×
49
    }
50
}
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