src/AuthenticationService.php
public function persistIdentity(ServerRequestInterface $request, ResponseInterface $response, $identity)
    {
        foreach ($this->authenticators() as $authenticator) {
            if ($authenticator instanceof PersistenceInterface) {
                $result = $authenticator->persistIdentity($request, $response, $identity);
                $request = $result['request'];
                $response = $result['response'];
            }
        }

        if (!($identity instanceof IdentityInterface)) {
            $identity = $this->buildIdentity($identity);
        }

        return [
            'request' => $request->withAttribute($this->getConfig('identityAttribute'), $identity),
            'response' => $response
        ];
    }
public function persistIdentity(ServerRequestInterface $request, ResponseInterface $response, $identity)
    {
        foreach ($this->authenticators() as $authenticator) {
            if ($authenticator instanceof PersistenceInterface) {
                $result = $authenticator->persistIdentity($request, $response, $identity);
                $request = $result['request'];
                $response = $result['response'];
            }
        }

        if (!($identity instanceof IdentityInterface)) {
            $identity = $this->buildIdentity($identity);
        }

        return [
            'request' => $request->withAttribute($this->getConfig('identityAttribute'), $identity),
            'response' => $response
        ];
    }
public function persistIdentity ( ServerRequestInterface $ request , ResponseInterface $ response , $ identity ) { foreach ( $ this -> authenticators ( ) as $ authenticator ) { if ( $ authenticator instanceof PersistenceInterface ) { $ result = $ authenticator -> persistIdentity ( $ request , $ response , $ identity ) ; $ request = $ result [ 'request' ] ; $ response = $ result [ 'response' ] ; } } if ( ! ( $ identity instanceof IdentityInterface ) ) { $ identity = $ this -> buildIdentity ( $ identity ) ; } return [ 'request' => $ request -> withAttribute ( $ this -> getConfig ( 'identityAttribute' ) , $ identity ) , 'response' => $ response ] ; }
Sets identity data and persists it in the authenticators that support it.

@param \Psr\Http\Message\ServerRequestInterface $request The request.
@param \Psr\Http\Message\ResponseInterface $response The response.
@param \ArrayAccess|array $identity Identity data.
@return array
Sets identity data and persists it in the authenticators that support it .