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;
use drupol\valuewrapper\Contract\Hashable;
/**
* Class AnonymousObject
*/
class AnonymousObject extends ObjectValue
{
* {@inheritdoc}
public function hash(): string
if ($this->value() instanceof Hashable) {
return $this->doHash($this->value()->hash());
}
throw new \Exception('The anonymous class must implement Hashable interface.');
protected function doHash(string $string) : string
return \sha1($string);
public function serialize()
throw new \BadMethodCallException('Unable to serialize this class.');
public function unserialize($serialized)
throw new \BadMethodCallException('Unable to unserialize this class.');