Skip to content

Commit 5ad58c3

Browse files
committed
Drop (dead) code for PHP 7
1 parent 8e3643d commit 5ad58c3

File tree

1 file changed

+0
-56
lines changed

1 file changed

+0
-56
lines changed

src/Carbon/Traits/Serialization.php

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -121,30 +121,9 @@ public static function __set_state($dump): static
121121
return static::instance($date);
122122
}
123123

124-
/**
125-
* Returns the list of properties to dump on serialize() called on.
126-
*
127-
* Only used by PHP < 7.4.
128-
*
129-
* @return array
130-
*/
131-
public function __sleep()
132-
{
133-
$properties = $this->getSleepProperties();
134-
135-
if ($this->localTranslator ?? null) {
136-
$properties[] = 'dumpLocale';
137-
$this->dumpLocale = $this->locale ?? null;
138-
}
139-
140-
return $properties;
141-
}
142-
143124
/**
144125
* Returns the values to dump on serialize() called on.
145126
*
146-
* Only used by PHP >= 7.4.
147-
*
148127
* @return array
149128
*/
150129
public function __serialize(): array
@@ -185,41 +164,6 @@ public function __serialize(): array
185164

186165
/**
187166
* Set locale if specified on unserialize() called.
188-
*
189-
* Only used by PHP < 7.4.
190-
*/
191-
public function __wakeup(): void
192-
{
193-
if (parent::class && method_exists(parent::class, '__wakeup')) {
194-
// @codeCoverageIgnoreStart
195-
try {
196-
parent::__wakeup();
197-
} catch (Throwable $exception) {
198-
try {
199-
// FatalError occurs when calling msgpack_unpack() in PHP 7.4 or later.
200-
['date' => $date, 'timezone' => $timezone] = $this->dumpDateProperties;
201-
parent::__construct($date, $timezone);
202-
} catch (Throwable) {
203-
throw $exception;
204-
}
205-
}
206-
// @codeCoverageIgnoreEnd
207-
}
208-
209-
$this->constructedObjectId = spl_object_hash($this);
210-
211-
if (isset($this->dumpLocale)) {
212-
$this->locale($this->dumpLocale);
213-
$this->dumpLocale = null;
214-
}
215-
216-
$this->cleanupDumpProperties();
217-
}
218-
219-
/**
220-
* Set locale if specified on unserialize() called.
221-
*
222-
* Only used by PHP >= 7.4.
223167
*/
224168
public function __unserialize(array $data): void
225169
{

0 commit comments

Comments
 (0)