1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27:
<?php
namespace Comprobo\Verify;
class State
{
private $state = [];
public function set($key, $value)
{
if (!is_string($key)) {
throw new Exceptions\Misconfiguration("State keys must be strings");
}
$this->state[$key] = $value;
}
public function get($key)
{
return $this->state[$key];
}
public function has($key)
{
return array_key_exists($key, $this->state);
}
}