private function checkFirstUser(Application $app, $route)
    {
        /** @var UsersRepository $repo */
        $repo = $app['storage']->getRepository(Entity\Users::class);
        try {
            $userCount = $repo->count();
        } catch (TableNotFoundException $e) {
            $app['schema']->update();
            $app['logger.flash']->info(Trans::__('general.phrase.users-none-create-first'));

            return $this->redirectToRoute('userfirst');
        }

        // If the users table is present, but there are no users, and we're on
        // /bolt/userfirst, we let the user stay, because they need to set up
        // the first user.
        if ($userCount === 0) {
            return $route === 'userfirst' ? null : $this->redirectToRoute('userfirst');
        }

        return true;
    }
private function checkFirstUser(Application $app, $route)
    {
        /** @var UsersRepository $repo */
        $repo = $app['storage']->getRepository(Entity\Users::class);
        try {
            $userCount = $repo->count();
        } catch (TableNotFoundException $e) {
            $app['schema']->update();
            $app['logger.flash']->info(Trans::__('general.phrase.users-none-create-first'));

            return $this->redirectToRoute('userfirst');
        }

        // If the users table is present, but there are no users, and we're on
        // /bolt/userfirst, we let the user stay, because they need to set up
        // the first user.
        if ($userCount === 0) {
            return $route === 'userfirst' ? null : $this->redirectToRoute('userfirst');
        }

        return true;
    }
private function checkFirstUser ( Application $ app , $ route ) { /** @var UsersRepository $repo */ $ repo = $ app [ 'storage' ] -> getRepository ( Entity \ Users :: class ) ; try { $ userCount = $ repo -> count ( ) ; } catch ( TableNotFoundException $ e ) { $ app [ 'schema' ] -> update ( ) ; $ app [ 'logger.flash' ] -> info ( Trans :: __ ( 'general.phrase.users-none-create-first' ) ) ; return $ this -> redirectToRoute ( 'userfirst' ) ; } // If the users table is present, but there are no users, and we're on // /bolt/userfirst, we let the user stay, because they need to set up // the first user. if ( $ userCount === 0 ) { return $ route === 'userfirst' ? null : $ this -> redirectToRoute ( 'userfirst' ) ; } return true ; }
Check and handle first user set up.

@param Application $app
@param mixed       $route

@return null|true|\Symfony\Component\HttpFoundation\RedirectResponse
Check and handle first user set up .