protected function fetchSregAttributes()
{
$attributes = [];
$sregToAx = array_flip($this->axToSregMap);
foreach ($this->data as $key => $value) {
$keyMatch = 'openid_sreg_';
if (strncmp($key, $keyMatch, strlen($keyMatch))) {
continue;
}
$key = substr($key, strlen($keyMatch));
if (!isset($sregToAx[$key])) {
// The field name isn't part of the SREG spec, so we ignore it.
continue;
}
$attributes[$sregToAx[$key]] = $value;
}
return $attributes;
}