/** * @param string $serialized * * @return void */ public function unserialize($serialized) { $data = unserialize($serialized); // add a few extra elements in the array to ensure that we have enough keys when unserializing // older data which does not include all properties. $data = array_merge($data, array_fill(0, 5, null)); list($this->idpEntityId, $this->spEntityId, $this->nameId, $this->nameIdFormat, $this->sessionIndex, $this->sessionInstant, $this->firstAuthOn, $this->lastAuthOn, $options, $this->parameters) = $data; // if deserialized from old format, set old options to new parameters if ($options && $this->parameters->count() == 0) { $this->parameters->replace($options); } }
/** * @param string $serialized * * @return void */ public function unserialize($serialized) { $data = unserialize($serialized); // add a few extra elements in the array to ensure that we have enough keys when unserializing // older data which does not include all properties. $data = array_merge($data, array_fill(0, 5, null)); $oldOptions = null; list($this->localSessionId, $this->ssoSessions, $oldOptions, $this->parameters) = $data; // in case it was serialized in old way, copy old options to parameters if ($oldOptions && $this->parameters->count() == 0) { $this->parameters->add($oldOptions); } }