/**
* Copy data from persistent storage to temporary one.
*
* @return mixed
* @throws ReadException
*/
private function selectFromStorage()
{
if (!$this->fs->exists($this->fsPath)) {
return $this->getEmptyStorage();
}
$data = json_decode($this->fs->read($this->fsPath), true);
if (!isset($data['pid']) || !$this->system->existsPid($data['pid'])) {
return $this->getEmptyStorage();
}
return $data;
}