public function factors() { $out = []; $types = [Type::INHERENCE(), Type::KNOWLEDGE(), Type::POSSESSION()]; foreach ($types as $type) { $out[] = [$this->getFactor($type)->reveal()]; } return $out; }
private function assertFactorTimestamps() : self { $data = [[FactorType::KNOWLEDGE(), $this->kfct, $this->kfet], [FactorType::POSSESSION(), $this->pfct, $this->pfet], [FactorType::INHERENCE(), $this->ifct, $this->ifet]]; foreach ($data as $types) { list($type, $create, $exp) = $types; $validation = $this->validateType($type, $create, $exp); switch ($validation) { case self::RET_OK: break; case self::RET_UNAUTH: throw new AE\AuthenticationRequiredException([]); case self::RET_EXP: throw new AE\FactorExpiredException([]); } } return $this; }