Spanner/src/Session/CacheSessionPool.php
private function getSession(array &$data)
    {
        $session = array_shift($data['queue']);

        if ($session) {
            if ($session['expiration'] - self::DURATION_ONE_MINUTE < $this->time()) {
                return $this->getSession($data);
            }

            $data['inUse'][$session['name']] = $session + [
                'lastActive' => $this->time()
            ];

            if ($this->config['shouldAutoDownsize']) {
                $this->manageSessionsToDelete($data);
            }
        }

        return $session;
    }
private function getSession(array &$data)
    {
        $session = array_shift($data['queue']);

        if ($session) {
            if ($session['expiration'] - self::DURATION_ONE_MINUTE < $this->time()) {
                return $this->getSession($data);
            }

            $data['inUse'][$session['name']] = $session + [
                'lastActive' => $this->time()
            ];

            if ($this->config['shouldAutoDownsize']) {
                $this->manageSessionsToDelete($data);
            }
        }

        return $session;
    }
private function getSession ( array & $ data ) { $ session = array_shift ( $ data [ 'queue' ] ) ; if ( $ session ) { if ( $ session [ 'expiration' ] - self :: DURATION_ONE_MINUTE < $ this -> time ( ) ) { return $ this -> getSession ( $ data ) ; } $ data [ 'inUse' ] [ $ session [ 'name' ] ] = $ session + [ 'lastActive' => $ this -> time ( ) ] ; if ( $ this -> config [ 'shouldAutoDownsize' ] ) { $ this -> manageSessionsToDelete ( $ data ) ; } } return $ session ; }
Gets the next session in the queue, clearing out any which are expired.

@param array $data
@return array|null
Gets the next session in the queue clearing out any which are expired .