diff --git a/CHANGELOG.md b/CHANGELOG.md index 81bd0ff..cde9098 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ CHANGELOG for 1.x =================== +## v1.11.0 - (2024-09-19) +### Added +`CreatableTrait` Trait & interface with creation date +`MonthYearTrait` Trait & interface with numeric representation of a month and his numeric year. Useful for statistics purposes. + +### Changed +`README.md` update : Add missing nelmio security settings configuration (@lfortunier) + +### Fixed +- `HistoryLogger` add missing STATUS_PROPERTY check on **log** update skip +- `NameableInterface::setName` add missing null case as it is mentioned on the trait +- `NameableTrait::name` property scope set as protected +- `PersonNameableTrait::getInitial` use mb_substr for string with first accentuated character + ## v1.10.0 - (2024-08-28) ### Added - `ArrayUtils::hasDuplicateValue` + tests (@lfortunier) diff --git a/CHANGELOG_add_trait_monthelable_and_created.md b/CHANGELOG_add_trait_monthelable_and_created.md deleted file mode 100644 index 3f3824a..0000000 --- a/CHANGELOG_add_trait_monthelable_and_created.md +++ /dev/null @@ -1,3 +0,0 @@ -### Added -`Entity::CreatableTrait` Trait & interface with creation date -`Entity::MonthYearTrait` Trait & interface with numeric representation of a month and his numeric year. Useful for statistics purposes. diff --git a/CHANGELOG_update_nelmio_security_doc.md b/CHANGELOG_update_nelmio_security_doc.md deleted file mode 100644 index b0e882f..0000000 --- a/CHANGELOG_update_nelmio_security_doc.md +++ /dev/null @@ -1,2 +0,0 @@ -### Changed -`README.md` update : Add missing nelmio security settings configuration (@lfortunier) \ No newline at end of file diff --git a/src/Entity/NameableInterface.php b/src/Entity/NameableInterface.php index a992776..574fad9 100644 --- a/src/Entity/NameableInterface.php +++ b/src/Entity/NameableInterface.php @@ -6,5 +6,5 @@ interface NameableInterface { public function getName(): ?string; - public function setName(string $name): self; + public function setName(?string $name): self; } diff --git a/src/Entity/NameableTrait.php b/src/Entity/NameableTrait.php index 5b55c66..af79e2a 100644 --- a/src/Entity/NameableTrait.php +++ b/src/Entity/NameableTrait.php @@ -15,7 +15,7 @@ trait NameableTrait #[ORM\Column(length: 255)] #[Assert\Length(max: 255)] #[Assert\NotBlank] - private ?string $name = null; + protected ?string $name = null; public function getName(): ?string { diff --git a/src/Entity/PersonNameableTrait.php b/src/Entity/PersonNameableTrait.php index c0bb5ce..21756ce 100644 --- a/src/Entity/PersonNameableTrait.php +++ b/src/Entity/PersonNameableTrait.php @@ -37,8 +37,8 @@ public function getInitial(): string { return sprintf( '%s%s', - substr(trim($this->getFirstName()), 0, 1), - substr(trim($this->getLastName()), 0, 1) + mb_substr(trim($this->getFirstName()), 0, 1), + mb_substr(trim($this->getLastName()), 0, 1) ); } diff --git a/src/Logger/HistoryLogger.php b/src/Logger/HistoryLogger.php index 70532f3..fa0b359 100644 --- a/src/Logger/HistoryLogger.php +++ b/src/Logger/HistoryLogger.php @@ -122,6 +122,7 @@ public function log(HistorizableInterface $entity, ?string $code = null, array $ if ( $code === self::UPDATED_CODE && !isset($history[self::DIFF_PROPERTY]) + && !isset($history[self::STATUS_PROPERTY]) && $this->title === null && $this->comment === null && $this->description === null