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

php-bug-catcher / bug-catcher / 17046755111

18 Aug 2025 04:41PM UTC coverage: 88.958% (-0.3%) from 89.297%
17046755111

push

github

tito10047
add code to errors so you can track your errors

14 of 18 new or added lines in 2 files covered. (77.78%)

854 of 960 relevant lines covered (88.96%)

6.84 hits per line

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

85.71
/src/Entity/Record.php
1
<?php
2

3
namespace BugCatcher\Entity;
4

5
use ApiPlatform\Metadata\ApiProperty;
6
use DateTime;
7
use DateTimeImmutable;
8
use DateTimeInterface;
9
use Symfony\Component\Serializer\Annotation\Groups;
10
use Symfony\Component\Uid\Uuid;
11
use Symfony\Component\Validator\Constraints as Assert;
12

13

14
abstract class Record {
15

16

17
        protected ?Uuid $id = null;
18

19
        #[Assert\NotBlank()]
20
        protected ?DateTimeInterface $date = null;
21

22
        #[Assert\NotNull(groups: ['Default'])]
23
        protected ?Project $project = null;
24

25
        protected string $status = 'new';
26

27
        protected ?string $hash = null;
28

29
        protected ?string $code = null;
30

31

32
        #[Groups(['record:write'])]
33
        #[Assert\NotBlank(groups: ['api'])]
34
        #[Assert\Length(min: 1, max: 50, groups: ['api'])]
35
        protected ?string $projectCode = null;
36

37
    #[Groups(['record:write'])]
38
    #[ApiProperty(openapiContext: [
39
        'type' => 'object',
40
        "additionalProperties" => [
41
            "type" => "string"
42
        ]
43
    ])]
44
    public ?array $metadata = null;
45

46
        public function __construct(?DateTimeInterface $date = null) {
47
                if ($date) {
50✔
48
                        $this->date = $date;
28✔
49
                } else {
50
                        $this->date = new DateTimeImmutable();
22✔
51
                }
52
        }
53

54
        private int $count = 1;
55
    private ?DateTime $firstOccurrence = null;
56

57
        public function getId(): ?Uuid {
58
                return $this->id;
21✔
59
        }
60

61
        public function getDate(): ?DateTimeInterface {
62
                return $this->date;
28✔
63
        }
64

65
        public function setDate(DateTimeInterface $date): static {
66
                $this->date = $date;
×
67

68
                return $this;
×
69
        }
70

71
        public function getProject(): ?Project {
72
                return $this->project;
24✔
73
        }
74

75
        public function setProject(?Project $project): static {
76
                $this->project = $project;
37✔
77

78
                return $this;
37✔
79
        }
80

81

82
        public function getStatus(): string {
83
                return $this->status;
25✔
84
        }
85

86
        public function setStatus(string $status): static {
87
                $this->status = $status;
22✔
88

89
                return $this;
22✔
90
        }
91

92

93
        public function getCount(): int {
94
                return $this->count;
28✔
95
        }
96

97
        public function setCount(int $count): self {
98
                $this->count = $count;
7✔
99

100
                return $this;
7✔
101
        }
102

103
    public function getFirstOccurrence(): ?DateTime
104
    {
105
        return $this->firstOccurrence;
21✔
106
    }
107

108
    public function setFirstOccurrence(?DateTime $firstOccurrence): self
109
    {
110
        $this->firstOccurrence = $firstOccurrence;
3✔
111
        return $this;
3✔
112
    }
113

114
        public function getProjectCode(): ?string {
115
                return $this->projectCode;
22✔
116
        }
117

118
        public function setProjectCode(?string $projectCode): self {
119
                $this->projectCode = $projectCode;
22✔
120

121
                return $this;
22✔
122
        }
123

124
        public function getHash(): ?string {
125
                return $this->hash;
31✔
126
        }
127

128
        public function setHash(?string $hash): self {
129
                $this->hash = $hash;
30✔
130

131
                return $this;
30✔
132
        }
133

134
        public function getCode(): ?string {
135
                return $this->code;
21✔
136
        }
137

138
        public function setCode(?string $code): self {
NEW
139
                $this->code = $code;
×
140

NEW
141
                return $this;
×
142
        }
143

144
        abstract function calculateHash(): ?string;
145

146
        abstract function getComponentName(): string;
147

148
        abstract function isError(): bool;
149

150

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