mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-13 21:59:34 +00:00
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:
parent
2d36373bea
commit
47d677b5db
3 changed files with 6 additions and 6 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ trait CompanyTrait
|
|||
}
|
||||
|
||||
/**
|
||||
* Set the addres.
|
||||
* Set the address.
|
||||
*
|
||||
* @param string $new_address the new address (with "\n" as line break)
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue