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

php-bug-catcher / bug-catcher / 20456731454

23 Dec 2025 09:21AM UTC coverage: 85.729% (-3.4%) from 89.142%
20456731454

push

github

web-flow
Merge pull request #17 from php-bug-catcher/selection

Added selection functionality to logs for batch proccesing

2 of 16 new or added lines in 3 files covered. (12.5%)

20 existing lines in 5 files now uncovered.

829 of 967 relevant lines covered (85.73%)

13.08 hits per line

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

65.0
/src/Repository/RecordLogTraceRepository.php
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Jozef Môstka
5
 * Date: 31. 5. 2024
6
 * Time: 15:54
7
 */
8

9
namespace BugCatcher\Repository;
10

11
use BugCatcher\Entity\Record;
12
use BugCatcher\Entity\RecordLogTrace;
13
use DateTimeImmutable;
14
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
15
use Doctrine\ORM\QueryBuilder;
16
use Doctrine\Persistence\ManagerRegistry;
17

18
/**
19
 * @method RecordLogTrace|null find($id, $lockMode = null, $lockVersion = null)
20
 * @method RecordLogTrace|null findOneBy(array $criteria, array $orderBy = null)
21
 * @method RecordLogTrace[] findAll()
22
 * @method RecordLogTrace[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
23
 */
24
final class RecordLogTraceRepository extends ServiceEntityRepository implements RecordRepositoryInterface
25
{
26
    public function __construct(
27
        ManagerRegistry $registry,
28
        private readonly RecordRepositoryInterface $recordRepository,
29
        protected readonly bool $clearStackTrace
30
    ) {
31
        parent::__construct($registry, RecordLogTrace::class);
2✔
32
    }
33

34
    protected function updateQb(
35
        string $newStatus,
36
                DateTimeImmutable $lastDate,
37
        string $previousStatus
38
    ): QueryBuilder {
39
        $qb = $this->createQueryBuilder("l");
2✔
40
        if ($newStatus == 'resolved' && $this->clearStackTrace) {
2✔
41
            $qb = $qb->set('l.stackTrace', 'NULL');
2✔
42
        }
43

44
        return $qb;
2✔
45
    }
46

47

48
    public function setStatusBetween(
49
        array $projects,
50
                DateTimeImmutable $from,
51
                DateTimeImmutable $to,
52
        string $newStatus,
53
        string $previousStatus = 'new',
54
                ?callable $qbCreator = null
55
    ): void {
UNCOV
56
        $this->recordRepository->setStatusBetween(
×
UNCOV
57
            $projects,
×
UNCOV
58
            $from, $to,
×
UNCOV
59
            $newStatus,
×
UNCOV
60
            $previousStatus,
×
UNCOV
61
            $this->updateQb(...)
×
UNCOV
62
        );
×
63
    }
64

65
    public function setStatus(
66
        Record $log,
67
                DateTimeImmutable $lastDate,
68
        string $newStatus,
69
        string $previousStatus = 'new',
70
        bool $flush = false,
71
                ?callable $qbCreator = null
72
    ) {
73
        $this->recordRepository->setStatus(
2✔
74
            $log,
2✔
75
            $lastDate,
2✔
76
            $newStatus,
2✔
77
            $previousStatus,
2✔
78
            $flush,
2✔
79
            $this->updateQb(...)
2✔
80
        );
2✔
81
    }
82
}
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