Fix code review issues: typos, docblock consistency, and null checks

Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-01-02 23:54:17 +00:00
parent 2d36373bea
commit 47d677b5db
3 changed files with 6 additions and 6 deletions

View file

@ -86,7 +86,7 @@ trait AttachmentsTrait
$this->attachments->removeElement($attachment); $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... //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); $this->setMasterPictureAttachment(null);
} }
@ -104,7 +104,7 @@ trait AttachmentsTrait
//Set master attachment is needed //Set master attachment is needed
foreach ($attachments as $attachment) { foreach ($attachments as $attachment) {
$clone = clone $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->setMasterPictureAttachment($clone);
} }
$this->addAttachment($clone); $this->addAttachment($clone);

View file

@ -94,7 +94,7 @@ trait CompanyTrait
} }
/** /**
* Set the addres. * Set the address.
* *
* @param string $new_address the new address (with "\n" as line break) * @param string $new_address the new address (with "\n" as line break)
* *

View file

@ -92,7 +92,7 @@ trait StructuralElementTrait
* Alternative names (semicolon-separated) for this element, which can be used for searching (especially for info provider system) * 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])] #[ORM\Column(type: Types::TEXT, nullable: true, options: ['default' => null])]
private ?string $alternative_names = ""; private ?string $alternative_names = null;
/** /**
* Initialize structural element collections. * Initialize structural element collections.
@ -153,7 +153,7 @@ trait StructuralElementTrait
/** /**
* Get the parent of this element. * 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 public function getParent(): ?self
{ {
@ -163,7 +163,7 @@ trait StructuralElementTrait
/** /**
* Get the comment of the element as markdown encoded string. * Get the comment of the element as markdown encoded string.
* *
* @return string the comment * @return string|null the comment
*/ */
public function getComment(): ?string public function getComment(): ?string
{ {