src/Controller/DefaultController.php
private function getTweetsVars($tweets, $vars)
    {
        /** @var string $firstTweetId */
        $firstTweetId = $tweets[0]->getId();

        $vars['previous'] = $this->tweetRepository
            ->getPreviousTweetId($firstTweetId);
        $vars['next'] = $this->tweetRepository
            ->getNextTweetId($firstTweetId);

        // Only update the cookie if the last Tweet Id is bigger than
        //  the one in the cookie
        if ($firstTweetId > $vars['cookieId']) {
            $vars['cookie'] = $this->createCookie($firstTweetId);
            $vars['cookieId'] = $firstTweetId;
        }

        $vars['number'] = $this->tweetRepository
            ->countPendingTweets($vars['cookieId']);

        $vars['first'] = $firstTweetId;

        return $vars;
    }
private function getTweetsVars($tweets, $vars)
    {
        /** @var string $firstTweetId */
        $firstTweetId = $tweets[0]->getId();

        $vars['previous'] = $this->tweetRepository
            ->getPreviousTweetId($firstTweetId);
        $vars['next'] = $this->tweetRepository
            ->getNextTweetId($firstTweetId);

        // Only update the cookie if the last Tweet Id is bigger than
        //  the one in the cookie
        if ($firstTweetId > $vars['cookieId']) {
            $vars['cookie'] = $this->createCookie($firstTweetId);
            $vars['cookieId'] = $firstTweetId;
        }

        $vars['number'] = $this->tweetRepository
            ->countPendingTweets($vars['cookieId']);

        $vars['first'] = $firstTweetId;

        return $vars;
    }
private function getTweetsVars ( $ tweets , $ vars ) { /** @var string $firstTweetId */ $ firstTweetId = $ tweets [ 0 ] -> getId ( ) ; $ vars [ 'previous' ] = $ this -> tweetRepository -> getPreviousTweetId ( $ firstTweetId ) ; $ vars [ 'next' ] = $ this -> tweetRepository -> getNextTweetId ( $ firstTweetId ) ; // Only update the cookie if the last Tweet Id is bigger than //  the one in the cookie if ( $ firstTweetId > $ vars [ 'cookieId' ] ) { $ vars [ 'cookie' ] = $ this -> createCookie ( $ firstTweetId ) ; $ vars [ 'cookieId' ] = $ firstTweetId ; } $ vars [ 'number' ] = $ this -> tweetRepository -> countPendingTweets ( $ vars [ 'cookieId' ] ) ; $ vars [ 'first' ] = $ firstTweetId ; return $ vars ; }
If a Tweet is displayed, fetch data from repository.

@param Tweet[] $tweets
@param array   $vars

@return array $vars
If a Tweet is displayed fetch data from repository .