for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace drupol\valuewrapper;
/**
* Class AbstractValue
*/
abstract class AbstractValue implements ValueInterface
{
* @var mixed
private $value;
* AbstractValue constructor.
*
* @param mixed $value
public function __construct($value)
$this->value = $value;
}
* {@inheritdoc}
public function value()
return $this->value;
public function __invoke()
return $this->value();
abstract public function serialize();
abstract public function unserialize($serialized);
* @param string $string
* The string to hash.
* @return string
* The string's hash.
protected function doHash(string $string) : string
return \sha1($string);
* Set the value.
protected function set($value)