Skip to content

Commit e3fdd2b

Browse files
committed
chore: As of PHP 8.1.0, calling this method has no effect; all properties are accessible by default. Symfony 7.3 requires PHP 8.2+.
https://www.php.net/manual/en/reflectionproperty.setaccessible.php
1 parent 5623395 commit e3fdd2b

File tree

3 files changed

+0
-7
lines changed

3 files changed

+0
-7
lines changed

src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,6 @@ public function testGetEnvDoesNotAutoCastNullWithDefaultEnvVarProcessor()
420420
$container->compile();
421421

422422
$r = new \ReflectionMethod($container, 'getEnv');
423-
$r->setAccessible(true);
424423
$this->assertNull($r->invoke($container, 'FOO'));
425424
}
426425

@@ -436,7 +435,6 @@ public function testGetEnvDoesNotAutoCastNullWithEnvVarProcessorsLocatorReturnin
436435
$container->compile();
437436

438437
$r = new \ReflectionMethod($container, 'getEnv');
439-
$r->setAccessible(true);
440438
$this->assertNull($r->invoke($container, 'FOO'));
441439
}
442440
}

src/Symfony/Component/ErrorHandler/Tests/ErrorHandlerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class ErrorHandlerTest extends TestCase
3434
protected function tearDown(): void
3535
{
3636
$r = new \ReflectionProperty(ErrorHandler::class, 'exitCode');
37-
$r->setAccessible(true);
3837
$r->setValue(null, 0);
3938
}
4039

src/Symfony/Component/Mailer/Tests/Transport/SendmailTransportTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ public function testThrowsTransportExceptionOnFailure()
9494
$sendmailTransport->send($mail, $envelope);
9595

9696
$streamProperty = new \ReflectionProperty(SendmailTransport::class, 'stream');
97-
$streamProperty->setAccessible(true);
9897
$stream = $streamProperty->getValue($sendmailTransport);
9998
$this->assertNull($stream->stream);
10099
}
@@ -112,10 +111,8 @@ public function testStreamIsClearedOnFailure()
112111
}
113112

114113
$streamProperty = new \ReflectionProperty(SendmailTransport::class, 'stream');
115-
$streamProperty->setAccessible(true);
116114
$stream = $streamProperty->getValue($sendmailTransport);
117115
$innerStreamProperty = new \ReflectionProperty(ProcessStream::class, 'stream');
118-
$innerStreamProperty->setAccessible(true);
119116
$this->assertNull($innerStreamProperty->getValue($stream));
120117
}
121118

@@ -127,7 +124,6 @@ public function testDoesNotThrowWhenInteractive()
127124

128125
$sendmailTransport = new SendmailTransport(self::FAKE_INTERACTIVE_SENDMAIL);
129126
$transportProperty = new \ReflectionProperty(SendmailTransport::class, 'transport');
130-
$transportProperty->setAccessible(true);
131127

132128
// Replace the transport with an anonymous consumer that trigger the stream methods
133129
$transportProperty->setValue($sendmailTransport, new class($transportProperty->getValue($sendmailTransport)->getStream()) extends SmtpTransport {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy