From 47d677b5dba80ebc1d936c7a3590da0d7ae49daf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 2 Jan 2026 23:54:17 +0000 Subject: [PATCH] Fix code review issues: typos, docblock consistency, and null checks Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com> --- src/Entity/Base/AttachmentsTrait.php | 4 ++-- src/Entity/Base/CompanyTrait.php | 2 +- src/Entity/Base/StructuralElementTrait.php | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Entity/Base/AttachmentsTrait.php b/src/Entity/Base/AttachmentsTrait.php index 79daab4f..c7dc7a18 100644 --- a/src/Entity/Base/AttachmentsTrait.php +++ b/src/Entity/Base/AttachmentsTrait.php @@ -86,7 +86,7 @@ trait AttachmentsTrait $this->attachments->removeElement($attachment); //Check if this is the master attachment -> remove it from master attachment too, or it can not be deleted from DB... - if (isset($this->master_picture_attachment) && $attachment === $this->master_picture_attachment) { + if ($this->master_picture_attachment !== null && $attachment === $this->master_picture_attachment) { $this->setMasterPictureAttachment(null); } @@ -104,7 +104,7 @@ trait AttachmentsTrait //Set master attachment is needed foreach ($attachments as $attachment) { $clone = clone $attachment; - if (isset($this->master_picture_attachment) && $attachment === $this->master_picture_attachment) { + if ($this->master_picture_attachment !== null && $attachment === $this->master_picture_attachment) { $this->setMasterPictureAttachment($clone); } $this->addAttachment($clone); diff --git a/src/Entity/Base/CompanyTrait.php b/src/Entity/Base/CompanyTrait.php index cb765def..059bfffb 100644 --- a/src/Entity/Base/CompanyTrait.php +++ b/src/Entity/Base/CompanyTrait.php @@ -94,7 +94,7 @@ trait CompanyTrait } /** - * Set the addres. + * Set the address. * * @param string $new_address the new address (with "\n" as line break) * diff --git a/src/Entity/Base/StructuralElementTrait.php b/src/Entity/Base/StructuralElementTrait.php index c76278b6..f8a2cabb 100644 --- a/src/Entity/Base/StructuralElementTrait.php +++ b/src/Entity/Base/StructuralElementTrait.php @@ -92,7 +92,7 @@ trait StructuralElementTrait * Alternative names (semicolon-separated) for this element, which can be used for searching (especially for info provider system) */ #[ORM\Column(type: Types::TEXT, nullable: true, options: ['default' => null])] - private ?string $alternative_names = ""; + private ?string $alternative_names = null; /** * Initialize structural element collections. @@ -153,7 +153,7 @@ trait StructuralElementTrait /** * Get the parent of this element. * - * @return static|null The parent element. Null if this element, does not have a parent. + * @return static|null The parent element. Null if this element does not have a parent. */ public function getParent(): ?self { @@ -163,7 +163,7 @@ trait StructuralElementTrait /** * Get the comment of the element as markdown encoded string. * - * @return string the comment + * @return string|null the comment */ public function getComment(): ?string {