private static function registerSingleton(Slim $app, Recaptcha $recaptcha = null)
    {
        if (is_null($recaptcha)) {
            $config = $app->config('recaptcha');
            $recaptcha = new Recaptcha($config['secret'], $config['siteKey']);
        }

        $app->container->singleton('recaptcha', function () use ($recaptcha) {
            return $recaptcha;
        });

        return $recaptcha;
    }
private static function registerSingleton(Slim $app, Recaptcha $recaptcha = null)
    {
        if (is_null($recaptcha)) {
            $config = $app->config('recaptcha');
            $recaptcha = new Recaptcha($config['secret'], $config['siteKey']);
        }

        $app->container->singleton('recaptcha', function () use ($recaptcha) {
            return $recaptcha;
        });

        return $recaptcha;
    }
private static function registerSingleton ( Slim $ app , Recaptcha $ recaptcha = null ) { if ( is_null ( $ recaptcha ) ) { $ config = $ app -> config ( 'recaptcha' ) ; $ recaptcha = new Recaptcha ( $ config [ 'secret' ] , $ config [ 'siteKey' ] ) ; } $ app -> container -> singleton ( 'recaptcha' , function ( ) use ( $ recaptcha ) { return $ recaptcha ; } ) ; return $ recaptcha ; }
Register the singleton with the application container.

@param  \Slim\Slim                $app       The application instance to register with.
@param  \Wowe\Recaptcha\Recaptcha $recaptcha The Recaptcha instance to bind to.
@return \Wowe\Recaptcha\Recaptcha
Register the singleton with the application container .