src/Silex/Provider/ConsoleServiceProvider.php
public function register(SilexApplication $app)
    {
        $app['console'] = $app->share(
            function () use ($app) {
                $application = new ConsoleApplication(
                    $app,
                    $app['console.name'],
                    $app['console.version']
                );

                // Sets default connection helper
                if (isset($app['db'])) {
                    $application->getHelperSet()->set(
                        new ConnectionHelper($app['db']),
                        'db'
                    );
                }

                $application->setDispatcher($app['dispatcher']);

                return $application;
            }
        );
    }
public function register(SilexApplication $app)
    {
        $app['console'] = $app->share(
            function () use ($app) {
                $application = new ConsoleApplication(
                    $app,
                    $app['console.name'],
                    $app['console.version']
                );

                // Sets default connection helper
                if (isset($app['db'])) {
                    $application->getHelperSet()->set(
                        new ConnectionHelper($app['db']),
                        'db'
                    );
                }

                $application->setDispatcher($app['dispatcher']);

                return $application;
            }
        );
    }
Registers services on the given app.

This method should only be used to configure services and parameters.
It should not get services.

@param SilexApplication $app Silex application instance

@return ConsoleApplication