src/Silex/Provider/ServiceProvider.php
public function register(Application $app)
    {
        foreach ($app['config']['services'] as $alias => $definition) {
            $app[$alias] = $app->share(
                function () use ($definition) {
                    return new $definition['class']();
                }
            );
        }
    }
public function register(Application $app)
    {
        foreach ($app['config']['services'] as $alias => $definition) {
            $app[$alias] = $app->share(
                function () use ($definition) {
                    return new $definition['class']();
                }
            );
        }
    }
Registers services on the given app.

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

@param Application $app Application instance

@return void