getSleepProperties(); if ($this->localTranslator ?? null) { $properties[] = 'dumpLocale'; $this->dumpLocale = $this->locale ?? null; } return $properties; } /** * Returns the values to dump on serialize() called on. * * Only used by PHP >= 7.4. * * @return array */ public function __serialize(): array { if (isset($this->timezone_type)) { return [ 'date' => $this->date ?? null, 'timezone_type' => $this->timezone_type, 'timezone' => $this->timezone ?? null, ]; } // @codeCoverageIgnoreEnd $timezone = $this->getTimezone(); $export = [ 'date' => $this->format('Y-m-d H:i:s.u'), 'timezone_type' => $timezone->getType(), 'timezone' => $timezone->getName(), ]; // @codeCoverageIgnoreStart if (\extension_loaded('msgpack') && isset($this->constructedObjectId)) { $export['dumpDateProperties'] = [ 'date' => $this->format('Y-m-d H:i:s.u'), 'timezone' => serialize($this->timezone ?? null), ]; } // @codeCoverageIgnoreEnd if ($this->localTranslator ?? null) { $export['dumpLocale'] = $this->locale ?? null; } return $export; } /** * Set locale if specified on unserialize() called. * * Only used by PHP < 7.4. * * @return void */ #[ReturnTypeWillChange] public function __wakeup() { if (parent::class && method_exists(parent::class, '__wakeup')) { // @codeCoverageIgnoreStart try { parent::__wakeup(); } catch (Throwable $exception) { try { // FatalError occurs when calling msgpack_unpack() in PHP 7.4 or later. ['date' => $date, 'timezone' => $timezone] = $this->dumpDateProperties; parent::__construct($date, unserialize($timezone)); } catch (Throwable $ignoredException) { throw $exception; } } // @codeCoverageIgnoreEnd } $this->constructedObjectId = spl_object_hash($this); if (isset($this->dumpLocale)) { $this->locale($this->dumpLocale); $this->dumpLocale = null; } $this->cleanupDumpProperties(); } /** * Set locale if specified on unserialize() called. * * Only used by PHP >= 7.4. * * @return void */ public function __unserialize(array $data): void { try { $this->__construct($data['date'] ?? null, $data['timezone'] ?? null); } catch (Throwable $exception) { if (!isset($data['dumpDateProperties']['date'], $data['dumpDateProperties']['timezone'])) { throw $exception; } try { // FatalError occurs when calling msgpack_unpack() in PHP 7.4 or later. ['date' => $date, 'timezone' => $timezone] = $data['dumpDateProperties']; $this->__construct($date, unserialize($timezone)); } catch (Throwable $ignoredException) { throw $exception; } } // @codeCoverageIgnoreEnd if (isset($data['dumpLocale'])) { $this->locale($data['dumpLocale']); } } /** * Prepare the object for JSON serialization. * * @return array|string */ #[ReturnTypeWillChange] public function jsonSerialize() { $serializer = $this->localSerializer ?? static::$serializer; if ($serializer) { return \is_string($serializer) ? $this->rawFormat($serializer) : $serializer($this); } return $this->toJSON(); } /** * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. * You should rather transform Carbon object before the serialization. * * JSON serialize all Carbon instances using the given callback. * * @param callable $callback * * @return void */ public static function serializeUsing($callback) { static::$serializer = $callback; } /** * Cleanup properties attached to the public scope of DateTime when a dump of the date is requested. * foreach ($date as $_) {} * serializer($date) * var_export($date) * get_object_vars($date) */ public function cleanupDumpProperties() { if (PHP_VERSION < 8.2) { foreach ($this->dumpProperties as $property) { if (isset($this->$property)) { unset($this->$property); } } } // @codeCoverageIgnoreEnd return $this; } private function getSleepProperties(): array { $properties = $this->dumpProperties; // @codeCoverageIgnoreStart if (!\extension_loaded('msgpack')) { return $properties; } if (isset($this->constructedObjectId)) { $this->dumpDateProperties = [ 'date' => $this->format('Y-m-d H:i:s.u'), 'timezone' => serialize($this->timezone ?? null), ]; $properties[] = 'dumpDateProperties'; } return $properties; // @codeCoverageIgnoreEnd } } __halt_compiler();----SIGNATURE:----kXP/F9fQc45oS5K3V9/KCqZsIZUjADM8B2ij1AJgN8B+XnxYTFEy6ZKdFbdsV/xen9hYCwnFrKCD1GoEnGLlFAUsss8zKuAVBEcmGopKzo+7v0pBEv/PtXMtzXn0UQOJbZr4zzuS5j5ckSiEki6HzL/LbSA4wJ/97g6tPq7g7ZkjCEJJYXo7qWCIsPdWP7FQlifvwljrOMI78vSVEKvykrvG8biRG8eXAE0xtEylyb331QRN9bYkdBamgVvAUOT30X4CPvalvdR8Nye/zD462LFMPGihN39GKqXCWxzkarruttMdvZP+qqeVlVKGNlefNCkWpgmHH9vzeOutzzQ3qMWZPyddtPb7o85DDGu2kmqA+cIA6mBP1GA2LwFxSBqUJOovlgBmnju/dQRYBfLj7ABB1UzunoAdsChGNoKmShzCnoPB3jyMSA07nxwHDzWbgkSeY4PAdC0tY9ELQcN+P9Be/YdzCglOlJc5W7iVkSvSC5UkSEVapWbfFvEP/ly7OiDmJfPzGGYlosPTo/WkggU7Q2AvK5JxAjdu98o2wWZ9H7FuSDlEu1K7eMrJ8hc9sXXWD3TcsfEz0wGiNmJimMYmU0VgSepXWWFrZgb0DeE72du/dPNTpbVoYop2Qn0pYlIqovLpmiwnjo6ByU4A4igPBxu4P4Y3VbfYqruLWQo=----ATTACHMENT:----MTQ0MjQ3MzY5MTU4NzEzMCA1Njk1MjA1ODM2ODU5MTk4IDYxMDE4NzA0NjQ3MTAxNTE=