Skip to content
Snippets Groups Projects
Commit 352c2af1 authored by Stefan Bürk's avatar Stefan Bürk Committed by Stefan B�rk
Browse files

[TASK] Use silence operator `@` for test setup

PHP8.3 emits a warning for content handed over to
unserialize() which contains superflous content at
the end.

The silence operator `@` is now used to suppress
the test setup unserialize() to avoid this exact
warning as preparation for PHP8.3 introduction.

Can be verified before and after by executing:

> Build/Scripts/runTests.sh -p 8.3 -s unitDeprecated

Resolves: #101409
Releases: main, 12.4, 11.5
Change-Id: I5741cd86e8e0a8afedb49ad01676d0766d5fbfaa
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80109


Tested-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarStefan B�rk <stefan@buerk.tech>
Reviewed-by: default avatarTorben Hansen <derhansen@gmail.com>
Tested-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: default avatarTorben Hansen <derhansen@gmail.com>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: default avatarStefan B�rk <stefan@buerk.tech>
parent 23a7466a
Branches
Tags
No related merge requests found
......@@ -30,7 +30,9 @@ final class ReflectionServiceTest extends UnitTestCase
public function reflectionServiceIsResetDuringWakeUp(): void
{
$insecureString = file_get_contents(__DIR__ . '/Fixture/InsecureSerializedReflectionService.txt');
$reflectionService = unserialize($insecureString);
// Note: We need to use the silence operator here for `unserialize()`, otherwise PHP8.3 would emit a warning
// because of unneeded bytes in the content which needs to be unserialized.
$reflectionService = @unserialize($insecureString);
$reflectionClass = new \ReflectionClass($reflectionService);
$classSchemaProperty = $reflectionClass->getProperty('classSchemata');
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment