for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace drupol\valuewrapper\Type;
use drupol\valuewrapper\AbstractValue;
use drupol\valuewrapper\Contract\Stringable;
use drupol\valuewrapper\ValueInterface;
/**
* Class TypeValue
*/
abstract class TypeValue extends AbstractValue implements Stringable
{
* {@inheritdoc}
public function hash(): string
return $this->doHash($this->type() . $this->value());
}
public function type()
return \gettype($this->value());
public function equals(ValueInterface $item, $strict = true) : bool
return ($strict === true) ?
$this === $item:
$this == $item;
public function serialize()
return \serialize([
'value' => $this->value(),
]);
public function unserialize($serialized)
$unserialize = \unserialize($serialized);
$this->set($unserialize['value']);
public function __toString(): string
return (string) $this->value();