diff --git a/src/View/Antlers/Language/Runtime/RuntimeParser.php b/src/View/Antlers/Language/Runtime/RuntimeParser.php index 5baa33d0901..e8883b58a49 100644 --- a/src/View/Antlers/Language/Runtime/RuntimeParser.php +++ b/src/View/Antlers/Language/Runtime/RuntimeParser.php @@ -510,7 +510,6 @@ private function addAntlersErrorDetails($exception, $text, $data) $rebuiltTrace = array_merge($rebuiltTrace, $exception->getTrace()); $traceProperty = new ReflectionProperty('Exception', 'trace'); - $traceProperty->setAccessible(true); $traceProperty->setValue($newException, $rebuiltTrace); $this->cleanUpTempFiles(); @@ -606,7 +605,6 @@ private function buildAntlersExceptionError(AntlersException $antlersException, $ignitionException = new $exceptionClass($newMessage, 0, 1, $exceptionView, $exceptionLine, $antlersException); $traceProperty = new ReflectionProperty('Exception', 'trace'); - $traceProperty->setAccessible(true); $traceProperty->setValue($ignitionException, $rebuiltTrace); $ignitionException->setViewData($data); diff --git a/src/Yaml/Yaml.php b/src/Yaml/Yaml.php index 560f56646c8..a1f8091a8f4 100644 --- a/src/Yaml/Yaml.php +++ b/src/Yaml/Yaml.php @@ -136,7 +136,6 @@ protected function viewException($e, $str, $line = null) 'args' => $args, ]); $traceProperty = new ReflectionProperty('Exception', 'trace'); - $traceProperty->setAccessible(true); $traceProperty->setValue($exception, $trace); return $exception; diff --git a/tests/Assets/AssetTest.php b/tests/Assets/AssetTest.php index 29c1cc60645..d805563faf8 100644 --- a/tests/Assets/AssetTest.php +++ b/tests/Assets/AssetTest.php @@ -953,7 +953,6 @@ public function when_saving_quietly_the_cached_assets_withEvents_flag_will_be_se $reflection = new ReflectionClass($asset); $property = $reflection->getProperty('withEvents'); - $property->setAccessible(true); $withEvents = $property->getValue($asset); $this->assertTrue($withEvents); } diff --git a/tests/Auth/ElevatedSessionTest.php b/tests/Auth/ElevatedSessionTest.php index 242670a63df..b90cd98dd92 100644 --- a/tests/Auth/ElevatedSessionTest.php +++ b/tests/Auth/ElevatedSessionTest.php @@ -437,7 +437,6 @@ public function it_returns_passkey_method_when_config_is_false_and_user_has_pass // Use reflection to set the passkeys property $reflection = new \ReflectionClass($user); $property = $reflection->getProperty('passkeys'); - $property->setAccessible(true); $property->setValue($user, $mockCollection); $this->assertEquals('passkey', $user->getElevatedSessionMethod()); @@ -456,7 +455,6 @@ public function it_returns_password_confirmation_method_when_config_is_true_even // Use reflection to set the passkeys property $reflection = new \ReflectionClass($user); $property = $reflection->getProperty('passkeys'); - $property->setAccessible(true); $property->setValue($user, $mockCollection); $this->assertEquals('password_confirmation', $user->getElevatedSessionMethod()); @@ -493,7 +491,6 @@ public function it_can_get_passkey_options_for_elevated_session() // Use reflection to set the passkeys property $reflection = new \ReflectionClass($user); $property = $reflection->getProperty('passkeys'); - $property->setAccessible(true); $property->setValue($user, $mockCollection); $response = $this @@ -520,7 +517,6 @@ public function it_can_start_elevated_session_with_passkey() // Use reflection to set the passkeys property $reflection = new \ReflectionClass($user); $property = $reflection->getProperty('passkeys'); - $property->setAccessible(true); $property->setValue($user, $mockCollection); $credentials = [ @@ -556,7 +552,6 @@ public function status_endpoint_returns_passkey_method() // Use reflection to set the passkeys property $reflection = new \ReflectionClass($user); $property = $reflection->getProperty('passkeys'); - $property->setAccessible(true); $property->setValue($user, $mockCollection); $this diff --git a/tests/Data/Entries/EntryTest.php b/tests/Data/Entries/EntryTest.php index a4b4f178926..8999fa762a8 100644 --- a/tests/Data/Entries/EntryTest.php +++ b/tests/Data/Entries/EntryTest.php @@ -1430,7 +1430,6 @@ public function when_saving_quietly_the_cached_entrys_withEvents_flag_will_be_se $cached = Cache::get('stache::items::entries::blog::1'); $reflection = new ReflectionClass($cached); $property = $reflection->getProperty('withEvents'); - $property->setAccessible(true); $withEvents = $property->getValue($cached); $this->assertTrue($withEvents); } diff --git a/tests/Feature/GraphQL/Fieldtypes/DateFieldtypeTest.php b/tests/Feature/GraphQL/Fieldtypes/DateFieldtypeTest.php index c34394aa1ca..cc24da567dd 100644 --- a/tests/Feature/GraphQL/Fieldtypes/DateFieldtypeTest.php +++ b/tests/Feature/GraphQL/Fieldtypes/DateFieldtypeTest.php @@ -19,7 +19,6 @@ public function setUp(): void $reflection = new ReflectionClass(self::this()); $factory = $reflection->getMethod('getFactory'); - $factory->setAccessible(true); return Arr::get($factory->invoke(self::this())->getSettings(), 'toStringFormat'); }); diff --git a/tests/Fieldtypes/UsersTest.php b/tests/Fieldtypes/UsersTest.php index 41b82bbe9ef..e6d81fe2543 100644 --- a/tests/Fieldtypes/UsersTest.php +++ b/tests/Fieldtypes/UsersTest.php @@ -164,7 +164,6 @@ private function cpUserWithPermissions(array $permissions) private function getColumns(Users $fieldtype): array { $method = new \ReflectionMethod($fieldtype, 'getColumns'); - $method->setAccessible(true); return $method->invoke($fieldtype); } diff --git a/tests/Imaging/GlideTest.php b/tests/Imaging/GlideTest.php index dc13ca922f3..49677c7cf6d 100644 --- a/tests/Imaging/GlideTest.php +++ b/tests/Imaging/GlideTest.php @@ -174,12 +174,10 @@ private function defaultFolderVisibility($filesystem) $reflection = new \ReflectionClass($adapter); $visibilityConverter = $reflection->getProperty('visibility'); - $visibilityConverter->setAccessible(true); $visibilityConverter = $visibilityConverter->getValue($adapter); $reflection = new \ReflectionClass($visibilityConverter); $visibility = $reflection->getProperty('defaultForDirectories'); - $visibility->setAccessible(true); return $visibility->getValue($visibilityConverter); } @@ -188,7 +186,6 @@ private function getAdapterFromFilesystem($filesystem) { $reflection = new \ReflectionClass($filesystem); $property = $reflection->getProperty('adapter'); - $property->setAccessible(true); return $property->getValue($filesystem); } @@ -197,7 +194,6 @@ private function getRootFromLocalAdapter($adapter) { $reflection = new \ReflectionClass($adapter); $property = $reflection->getProperty('prefixer'); - $property->setAccessible(true); $prefixer = $property->getValue($adapter); return $prefixer->prefixPath(''); diff --git a/tests/Imaging/ImageGeneratorTest.php b/tests/Imaging/ImageGeneratorTest.php index 50a5ca50bb1..e881c61fee1 100644 --- a/tests/Imaging/ImageGeneratorTest.php +++ b/tests/Imaging/ImageGeneratorTest.php @@ -445,7 +445,6 @@ private function getRootFromLocalAdapter($adapter) { $reflection = new \ReflectionClass($adapter); $property = $reflection->getProperty('prefixer'); - $property->setAccessible(true); $prefixer = $property->getValue($adapter); return $prefixer->prefixPath(''); @@ -455,7 +454,6 @@ private function getAdapterFromFilesystem($filesystem) { $reflection = new \ReflectionClass($filesystem); $property = $reflection->getProperty('adapter'); - $property->setAccessible(true); return $property->getValue($filesystem); } diff --git a/tests/Stache/StoreTest.php b/tests/Stache/StoreTest.php index d6f01ea311b..419e2d2ddbc 100644 --- a/tests/Stache/StoreTest.php +++ b/tests/Stache/StoreTest.php @@ -38,7 +38,6 @@ public function it_forces_a_trailing_slash_when_setting_the_directory() // Check the value of the property to make sure the property was set with // the slash, and that ->directory() isn't just appending it. $property = (new \ReflectionClass($this->store))->getProperty('directory'); - $property->setAccessible(true); $this->assertEquals('/path/to/directory/', $property->getValue($this->store)); } diff --git a/tests/Stache/Stores/CollectionTreeStoreTest.php b/tests/Stache/Stores/CollectionTreeStoreTest.php index ab70bee9bab..a98459069c7 100644 --- a/tests/Stache/Stores/CollectionTreeStoreTest.php +++ b/tests/Stache/Stores/CollectionTreeStoreTest.php @@ -176,7 +176,6 @@ private function assertTree($array, $item) // the structure. That'll happen later within the repository. $reflect = new \ReflectionObject($item); $property = $reflect->getProperty('tree'); - $property->setAccessible(true); $this->assertEquals($array, $property->getValue($item)); } } diff --git a/tests/Stache/Stores/NavTreeStoreTest.php b/tests/Stache/Stores/NavTreeStoreTest.php index 62f1dca4ff6..1587391d969 100644 --- a/tests/Stache/Stores/NavTreeStoreTest.php +++ b/tests/Stache/Stores/NavTreeStoreTest.php @@ -140,7 +140,6 @@ private function assertTree($array, $item) // the structure. That'll happen later within the repository. $reflect = new \ReflectionObject($item); $property = $reflect->getProperty('tree'); - $property->setAccessible(true); $this->assertEquals($array, $property->getValue($item)); } }