Skip to content

Commit ac5a17d

Browse files
authored
Remove Serializable implementation (#11469)
1 parent f4bbf8e commit ac5a17d

File tree

3 files changed

+10
-39
lines changed

3 files changed

+10
-39
lines changed

UPGRADE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Upgrade to 4.0
22

3+
## Remove remaining `Serializable` implementation
4+
5+
`SequenceGenerator` does not implement the `Serializable` interface anymore.
6+
7+
The following methods have been removed:
8+
9+
* `SequenceGenerator::serialize()`
10+
* `SequenceGenerator::unserialize()`
11+
312
## Remove `orm:schema-tool:update` option `--complete`
413

514
That option was a no-op.

psalm-baseline.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,6 @@
206206
<code><![CDATA[$entity]]></code>
207207
</PossiblyNullArgument>
208208
</file>
209-
<file src="src/Id/SequenceGenerator.php">
210-
<ParamNameMismatch>
211-
<code><![CDATA[$serialized]]></code>
212-
</ParamNameMismatch>
213-
</file>
214209
<file src="src/Internal/Hydration/AbstractHydrator.php">
215210
<ReferenceConstraintViolation>
216211
<code><![CDATA[return $rowData;]]></code>

src/Id/SequenceGenerator.php

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,12 @@
55
namespace Doctrine\ORM\Id;
66

77
use Doctrine\DBAL\Connections\PrimaryReadReplicaConnection;
8-
use Doctrine\Deprecations\Deprecation;
98
use Doctrine\ORM\EntityManagerInterface;
10-
use Serializable;
11-
12-
use function serialize;
13-
use function unserialize;
149

1510
/**
1611
* Represents an ID generator that uses a database sequence.
1712
*/
18-
class SequenceGenerator extends AbstractIdGenerator implements Serializable
13+
class SequenceGenerator extends AbstractIdGenerator
1914
{
2015
private int $nextValue = 0;
2116
private int|null $maxValue = null;
@@ -66,20 +61,6 @@ public function getNextValue(): int
6661
return $this->nextValue;
6762
}
6863

69-
/** @deprecated without replacement. */
70-
final public function serialize(): string
71-
{
72-
Deprecation::trigger(
73-
'doctrine/orm',
74-
'https://github.com/doctrine/orm/pull/11468',
75-
'%s() is deprecated, use __serialize() instead. %s won\'t implement the Serializable interface anymore in ORM 4.',
76-
__METHOD__,
77-
self::class,
78-
);
79-
80-
return serialize($this->__serialize());
81-
}
82-
8364
/** @return array<string, mixed> */
8465
public function __serialize(): array
8566
{
@@ -89,20 +70,6 @@ public function __serialize(): array
8970
];
9071
}
9172

92-
/** @deprecated without replacement. */
93-
final public function unserialize(string $serialized): void
94-
{
95-
Deprecation::trigger(
96-
'doctrine/orm',
97-
'https://github.com/doctrine/orm/pull/11468',
98-
'%s() is deprecated, use __unserialize() instead. %s won\'t implement the Serializable interface anymore in ORM 4.',
99-
__METHOD__,
100-
self::class,
101-
);
102-
103-
$this->__unserialize(unserialize($serialized));
104-
}
105-
10673
/** @param array<string, mixed> $data */
10774
public function __unserialize(array $data): void
10875
{

0 commit comments

Comments
 (0)