From 39836b0b848515b710c68401865d6988fbc74459 Mon Sep 17 00:00:00 2001 From: Abdellah Ramadan Date: Tue, 15 Jul 2025 10:43:04 +0100 Subject: [PATCH] make slug nullable initiality --- src/Entity/LoggedEntity/.gitignore | 1 + src/Entity/Traits/MappedSluggedTrait.php | 2 +- src/Entity/Traits/SluggedTrait.php | 2 +- tests/Util/App/BaseKernel.php | 2 -- tests/Util/App/Kernel.php | 3 +++ 5 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 src/Entity/LoggedEntity/.gitignore diff --git a/src/Entity/LoggedEntity/.gitignore b/src/Entity/LoggedEntity/.gitignore new file mode 100644 index 0000000..a30f2c8 --- /dev/null +++ b/src/Entity/LoggedEntity/.gitignore @@ -0,0 +1 @@ +LoggedEntity.php \ No newline at end of file diff --git a/src/Entity/Traits/MappedSluggedTrait.php b/src/Entity/Traits/MappedSluggedTrait.php index 8ea9b48..ba6e10e 100644 --- a/src/Entity/Traits/MappedSluggedTrait.php +++ b/src/Entity/Traits/MappedSluggedTrait.php @@ -24,7 +24,7 @@ public function getSlug(): ?string return $this->slug; } - public function setSlug(string $slug): static + public function setSlug(?string $slug): static { $this->slug = $slug; return $this; diff --git a/src/Entity/Traits/SluggedTrait.php b/src/Entity/Traits/SluggedTrait.php index 6dd441d..8e74bc8 100644 --- a/src/Entity/Traits/SluggedTrait.php +++ b/src/Entity/Traits/SluggedTrait.php @@ -11,7 +11,7 @@ public function getSlug(): ?string return $this->slug; } - public function setSlug(string $slug): static + public function setSlug(?string $slug): static { $this->slug = $slug; return $this; diff --git a/tests/Util/App/BaseKernel.php b/tests/Util/App/BaseKernel.php index e2c0ad3..eb6c33e 100644 --- a/tests/Util/App/BaseKernel.php +++ b/tests/Util/App/BaseKernel.php @@ -12,9 +12,7 @@ namespace Rami\EntityKitBundle\Tests\Util\App; use Doctrine\ORM\EntityManager; -use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Tools\SchemaTool; -use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\Filesystem\Filesystem; diff --git a/tests/Util/App/Kernel.php b/tests/Util/App/Kernel.php index ae765b8..0b633d7 100644 --- a/tests/Util/App/Kernel.php +++ b/tests/Util/App/Kernel.php @@ -33,6 +33,9 @@ public function registerBundles(): iterable ]; } + /** + * @throws \Exception + */ public function registerContainerConfiguration(LoaderInterface $loader): void { $loader->load(__DIR__ . '/config/config.yaml');