for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace drupol\valuewrapper\Object;
/**
* Class AbstractExceptionObject
*/
abstract class AbstractExceptionObject extends ObjectValue
{
* {@inheritdoc}
public function hash(): string
/** @var \TypeError $value */
$value = $this->get();
$data = [
'message' => $value->getMessage(),
'code' => $value->getCode(),
'class' => get_class($this->get()),
];
return $this->doHash(implode('', $data));
}
public function serialize()
/** @var \Exception $exception */
$exception = $this->get();
'message' => $exception->getMessage(),
'code' => $exception->getCode(),
return \serialize([
'value' => $data,
]);
public function unserialize($serialized)
$unserialize = \unserialize($serialized);
$this->set(
(new \Exception($unserialize['value']['message'], $unserialize['value']['code']))
);