Skip to content

Commit b74f58d

Browse files
committed
Dumper: removed support for obsolete Serializable
1 parent 3eacc03 commit b74f58d

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

src/PhpGenerator/Dumper.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,6 @@ private function dumpObject(object $var, array $parents, int $level): string
143143
if (in_array($class, [\DateTime::class, \DateTimeImmutable::class], strict: true)) {
144144
return $this->format("new \\$class(?, new \\DateTimeZone(?))", $var->format('Y-m-d H:i:s.u'), $var->getTimeZone()->getName());
145145

146-
} elseif ($var instanceof \Serializable) {
147-
return 'unserialize(' . $this->dumpString(serialize($var)) . ')';
148-
149146
} elseif ($var instanceof \UnitEnum) {
150147
return '\\' . $var::class . '::' . $var->name;
151148

tests/PhpGenerator/Dumper.dump().phpt

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -154,29 +154,6 @@ Assert::exception(function () {
154154

155155

156156

157-
// serializable
158-
if (PHP_VERSION_ID < 80100) {
159-
class Test3 implements Serializable
160-
{
161-
private $a;
162-
163-
164-
public function serialize()
165-
{
166-
return '';
167-
}
168-
169-
170-
public function unserialize($s)
171-
{
172-
}
173-
}
174-
175-
Assert::same('unserialize(\'C:5:"Test3":0:{}\')', $dumper->dump(new Test3));
176-
Assert::equal(new Test3, eval('return ' . $dumper->dump(new Test3) . ';'));
177-
}
178-
179-
180157
// __serialize
181158
class TestSer
182159
{

0 commit comments

Comments
 (0)