From 12f5c4e14df683536f2c33f65a5a54336d059822 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 2 Jan 2026 23:55:40 +0000 Subject: [PATCH] Address additional code review feedback: trait dependencies and grammar Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com> --- src/Entity/Base/AttachmentsTrait.php | 6 +++++- src/Entity/Base/StructuralElementTrait.php | 4 ++-- src/Entity/Contracts/StructuralElementInterface.php | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Entity/Base/AttachmentsTrait.php b/src/Entity/Base/AttachmentsTrait.php index c7dc7a18..53c1fc36 100644 --- a/src/Entity/Base/AttachmentsTrait.php +++ b/src/Entity/Base/AttachmentsTrait.php @@ -32,8 +32,12 @@ use Symfony\Component\Serializer\Annotation\Groups; * * Requirements: * - Class using this trait should have $id property (e.g., via DBElementTrait) - * - Class may optionally have $master_picture_attachment property (via MasterAttachmentTrait) + * - Class using this trait should use MasterAttachmentTrait for full functionality * - Class should implement HasAttachmentsInterface + * + * Note: This trait has an optional dependency on MasterAttachmentTrait. + * If MasterAttachmentTrait is used, the removeAttachment and cloneAttachments methods + * will handle master picture attachment properly. Otherwise, those checks are no-ops. */ trait AttachmentsTrait { diff --git a/src/Entity/Base/StructuralElementTrait.php b/src/Entity/Base/StructuralElementTrait.php index f8a2cabb..728ef09c 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 = null; + private ?string $alternative_names = ''; /** * Initialize structural element collections. @@ -189,7 +189,7 @@ trait StructuralElementTrait * * The level of the root node is -1. * - * @return int the level of this element (zero means a most top element + * @return int the level of this element (zero means the topmost element * [a sub element of the root node]) */ public function getLevel(): int diff --git a/src/Entity/Contracts/StructuralElementInterface.php b/src/Entity/Contracts/StructuralElementInterface.php index d4a17181..9743c9dd 100644 --- a/src/Entity/Contracts/StructuralElementInterface.php +++ b/src/Entity/Contracts/StructuralElementInterface.php @@ -64,7 +64,7 @@ interface StructuralElementInterface * * The level of the root node is -1. * - * @return int the level of this element (zero means a most top element) + * @return int the level of this element (zero means the topmost element) */ public function getLevel(): int; }