Skip to content

Commit 47d677b

Browse files
Copilotjbtronics
andcommitted
Fix code review issues: typos, docblock consistency, and null checks
Co-authored-by: jbtronics <[email protected]>
1 parent 2d36373 commit 47d677b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/Entity/Base/AttachmentsTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function removeAttachment(Attachment $attachment): self
8686
$this->attachments->removeElement($attachment);
8787

8888
//Check if this is the master attachment -> remove it from master attachment too, or it can not be deleted from DB...
89-
if (isset($this->master_picture_attachment) && $attachment === $this->master_picture_attachment) {
89+
if ($this->master_picture_attachment !== null && $attachment === $this->master_picture_attachment) {
9090
$this->setMasterPictureAttachment(null);
9191
}
9292

@@ -104,7 +104,7 @@ protected function cloneAttachments(): void
104104
//Set master attachment is needed
105105
foreach ($attachments as $attachment) {
106106
$clone = clone $attachment;
107-
if (isset($this->master_picture_attachment) && $attachment === $this->master_picture_attachment) {
107+
if ($this->master_picture_attachment !== null && $attachment === $this->master_picture_attachment) {
108108
$this->setMasterPictureAttachment($clone);
109109
}
110110
$this->addAttachment($clone);

src/Entity/Base/CompanyTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function getAddress(): string
9494
}
9595

9696
/**
97-
* Set the addres.
97+
* Set the address.
9898
*
9999
* @param string $new_address the new address (with "\n" as line break)
100100
*

src/Entity/Base/StructuralElementTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ trait StructuralElementTrait
9292
* Alternative names (semicolon-separated) for this element, which can be used for searching (especially for info provider system)
9393
*/
9494
#[ORM\Column(type: Types::TEXT, nullable: true, options: ['default' => null])]
95-
private ?string $alternative_names = "";
95+
private ?string $alternative_names = null;
9696

9797
/**
9898
* Initialize structural element collections.
@@ -153,7 +153,7 @@ public function isRoot(): bool
153153
/**
154154
* Get the parent of this element.
155155
*
156-
* @return static|null The parent element. Null if this element, does not have a parent.
156+
* @return static|null The parent element. Null if this element does not have a parent.
157157
*/
158158
public function getParent(): ?self
159159
{
@@ -163,7 +163,7 @@ public function getParent(): ?self
163163
/**
164164
* Get the comment of the element as markdown encoded string.
165165
*
166-
* @return string the comment
166+
* @return string|null the comment
167167
*/
168168
public function getComment(): ?string
169169
{

0 commit comments

Comments
 (0)