From 532700028a53872429bf347e0a0ede82a73fb3a0 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 28 Oct 2025 11:03:41 +0100 Subject: [PATCH] Remove all calls to ReflectionProperty::setAccessible --- module/CLI/test/Util/ShlinkTableTest.php | 1 - .../test-db/ShortUrl/Repository/ShortUrlListRepositoryTest.php | 1 - module/Rest/test-api/Fixtures/ShortUrlsFixture.php | 1 - .../EmptyResponseImplicitOptionsMiddlewareFactoryTest.php | 1 - 4 files changed, 4 deletions(-) diff --git a/module/CLI/test/Util/ShlinkTableTest.php b/module/CLI/test/Util/ShlinkTableTest.php index 19d477ef..e80e1f8b 100644 --- a/module/CLI/test/Util/ShlinkTableTest.php +++ b/module/CLI/test/Util/ShlinkTableTest.php @@ -51,7 +51,6 @@ class ShlinkTableTest extends TestCase $ref = new ReflectionObject($instance); $baseTable = $ref->getProperty('baseTable'); - $baseTable->setAccessible(true); self::assertInstanceOf(Table::class, $baseTable->getValue($instance)); } diff --git a/module/Core/test-db/ShortUrl/Repository/ShortUrlListRepositoryTest.php b/module/Core/test-db/ShortUrl/Repository/ShortUrlListRepositoryTest.php index 23f21171..11cbfde1 100644 --- a/module/Core/test-db/ShortUrl/Repository/ShortUrlListRepositoryTest.php +++ b/module/Core/test-db/ShortUrl/Repository/ShortUrlListRepositoryTest.php @@ -85,7 +85,6 @@ class ShortUrlListRepositoryTest extends DatabaseTestCase $foo2->setVisits(new ArrayCollection($visits2)); $ref = new ReflectionObject($foo2); $dateProp = $ref->getProperty('dateCreated'); - $dateProp->setAccessible(true); $dateProp->setValue($foo2, Chronos::now()->subDays(5)); $this->getEntityManager()->persist($foo2); diff --git a/module/Rest/test-api/Fixtures/ShortUrlsFixture.php b/module/Rest/test-api/Fixtures/ShortUrlsFixture.php index 31ca6361..aec8098f 100644 --- a/module/Rest/test-api/Fixtures/ShortUrlsFixture.php +++ b/module/Rest/test-api/Fixtures/ShortUrlsFixture.php @@ -98,7 +98,6 @@ class ShortUrlsFixture extends AbstractFixture implements DependentFixtureInterf { $ref = new ReflectionObject($shortUrl); $dateProp = $ref->getProperty('dateCreated'); - $dateProp->setAccessible(true); $dateProp->setValue($shortUrl, Chronos::parse($date)); return $shortUrl; diff --git a/module/Rest/test/Middleware/EmptyResponseImplicitOptionsMiddlewareFactoryTest.php b/module/Rest/test/Middleware/EmptyResponseImplicitOptionsMiddlewareFactoryTest.php index 6c051fda..bee602f3 100644 --- a/module/Rest/test/Middleware/EmptyResponseImplicitOptionsMiddlewareFactoryTest.php +++ b/module/Rest/test/Middleware/EmptyResponseImplicitOptionsMiddlewareFactoryTest.php @@ -27,7 +27,6 @@ class EmptyResponseImplicitOptionsMiddlewareFactoryTest extends TestCase $ref = new ReflectionObject($instance); $prop = $ref->getProperty('responseFactory'); - $prop->setAccessible(true); /** @var ResponseFactoryInterface $value */ $value = $prop->getValue($instance);