public function setState($state) { if (!is_string($state) || 0 >= strlen($state)) { throw new TokenException('state needs to be a non-empty string'); } $this->state = $state; }