Skip to content

Commit 743fc18

Browse files
committed
ISSUE-345: make format props bool
1 parent c5d1429 commit 743fc18

File tree

3 files changed

+51
-21
lines changed

3 files changed

+51
-21
lines changed

src/Domain/Model/Messaging/Message/MessageFormat.php

+45-15
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@ class MessageFormat
1616
private ?string $sendFormat = null;
1717

1818
#[ORM\Column(name: 'astext', type: 'integer', options: ['default' => 0])]
19-
private int $asText;
19+
private bool $asText;
2020

2121
#[ORM\Column(name: 'ashtml', type: 'integer', options: ['default' => 0])]
22-
private int $asHtml;
22+
private bool $asHtml;
2323

2424
#[ORM\Column(name: 'aspdf', type: 'integer', options: ['default' => 0])]
25-
private int $asPdf;
25+
private bool $asPdf;
2626

2727
#[ORM\Column(name: 'astextandhtml', type: 'integer', options: ['default' => 0])]
28-
private int $asTextAndHtml;
28+
private bool $asTextAndHtml;
2929

3030
#[ORM\Column(name: 'astextandpdf', type: 'integer', options: ['default' => 0])]
31-
private int $asTextAndPdf;
31+
private bool $asTextAndPdf;
3232

3333
public function __construct(
3434
bool $htmlFormatted,
3535
string $sendFormat = null,
36-
int $asText = 0,
37-
int $asHtml = 0,
38-
int $asPdf = 0,
39-
int $asTextAndHtml = 0,
40-
int $asTextAndPdf = 0,
36+
bool $asText = false,
37+
bool $asHtml = false,
38+
bool $asPdf = false,
39+
bool $asTextAndHtml = false,
40+
bool $asTextAndPdf = false,
4141
) {
4242
$this->htmlFormatted = $htmlFormatted;
4343
$this->sendFormat = $sendFormat;
@@ -58,27 +58,27 @@ public function getSendFormat(): ?string
5858
return $this->sendFormat;
5959
}
6060

61-
public function getAsText(): int
61+
public function isAsText(): bool
6262
{
6363
return $this->asText;
6464
}
6565

66-
public function getAsHtml(): int
66+
public function isAsHtml(): bool
6767
{
6868
return $this->asHtml;
6969
}
7070

71-
public function getAsTextAndHtml(): int
71+
public function isAsTextAndHtml(): bool
7272
{
7373
return $this->asTextAndHtml;
7474
}
7575

76-
public function getAsPdf(): int
76+
public function isAsPdf(): bool
7777
{
7878
return $this->asPdf;
7979
}
8080

81-
public function getAsTextAndPdf(): int
81+
public function isAsTextAndPdf(): bool
8282
{
8383
return $this->asTextAndPdf;
8484
}
@@ -88,4 +88,34 @@ public function setSendFormat(?string $sendFormat): self
8888
$this->sendFormat = $sendFormat;
8989
return $this;
9090
}
91+
92+
public function setAsText(bool $asText): self
93+
{
94+
$this->asText = $asText;
95+
return $this;
96+
}
97+
98+
public function setAsHtml(bool $asHtml): self
99+
{
100+
$this->asHtml = $asHtml;
101+
return $this;
102+
}
103+
104+
public function setAsPdf(bool $asPdf): self
105+
{
106+
$this->asPdf = $asPdf;
107+
return $this;
108+
}
109+
110+
public function setAsTextAndHtml(bool $asTextAndHtml): self
111+
{
112+
$this->asTextAndHtml = $asTextAndHtml;
113+
return $this;
114+
}
115+
116+
public function setAsTextAndPdf(bool $asTextAndPdf): self
117+
{
118+
$this->asTextAndPdf = $asTextAndPdf;
119+
return $this;
120+
}
91121
}

src/Domain/Model/Messaging/Message/MessageOptions.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function getToField(): string
6464
return $this->toField;
6565
}
6666

67-
public function getReplyToO(): string
67+
public function getReplyTo(): string
6868
{
6969
return $this->replyTo;
7070
}

tests/Integration/Domain/Repository/Fixtures/MessageFixture.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ public function load(ObjectManager $manager): void
4848
$format = new MessageFormat(
4949
$row['htmlformatted'],
5050
$row['sendformat'],
51-
$row['astext'],
52-
$row['ashtml'],
53-
$row['aspdf'],
54-
$row['astextandhtml'],
55-
$row['astextandpdf']
51+
(bool)$row['astext'],
52+
(bool)$row['ashtml'],
53+
(bool)$row['aspdf'],
54+
(bool)$row['astextandhtml'],
55+
(bool)$row['astextandpdf']
5656
);
5757

5858
$schedule = new MessageSchedule(

0 commit comments

Comments
 (0)