public final function setState($key, $value) { if ($value === null) { unset($this->registry[$key]); } else { $this->registry[$key] = $value; } }