src/lib/Herrera/Wise/WiseServiceProvider.php
public static function registerServices(Application $app)
    {
        $file = $app['wise.options']['config']['services'];

        if ('prod' !== $app['wise.options']['mode']) {
            $file .= '_' . $app['wise.options']['mode'];
        }

        $file .= '.' . $app['wise.options']['type'];

        /** @var $wise Wise */
        $wise = $app['wise'];
        $services = $wise->load($file);

        unset($services['parameters']);
        unset($services['imports']);

        foreach ($services as $name => $service) {
            if (null === $service) {
                continue;
            }

            if (!isset($service['class'])) {
                throw InvalidArgumentException::format(
                    'The service "%s" did not specify its "class".',
                    $name
                );
            }

            if (!isset($service['parameters'])) {
                $service['parameters'] = array();
            }

            $app->register(new $service['class'](), $service['parameters']);
        }
    }
public static function registerServices(Application $app)
    {
        $file = $app['wise.options']['config']['services'];

        if ('prod' !== $app['wise.options']['mode']) {
            $file .= '_' . $app['wise.options']['mode'];
        }

        $file .= '.' . $app['wise.options']['type'];

        /** @var $wise Wise */
        $wise = $app['wise'];
        $services = $wise->load($file);

        unset($services['parameters']);
        unset($services['imports']);

        foreach ($services as $name => $service) {
            if (null === $service) {
                continue;
            }

            if (!isset($service['class'])) {
                throw InvalidArgumentException::format(
                    'The service "%s" did not specify its "class".',
                    $name
                );
            }

            if (!isset($service['parameters'])) {
                $service['parameters'] = array();
            }

            $app->register(new $service['class'](), $service['parameters']);
        }
    }
public static function registerServices ( Application $ app ) { $ file = $ app [ 'wise.options' ] [ 'config' ] [ 'services' ] ; if ( 'prod' !== $ app [ 'wise.options' ] [ 'mode' ] ) { $ file .= '_' . $ app [ 'wise.options' ] [ 'mode' ] ; } $ file .= '.' . $ app [ 'wise.options' ] [ 'type' ] ; /** @var $wise Wise */ $ wise = $ app [ 'wise' ] ; $ services = $ wise -> load ( $ file ) ; unset ( $ services [ 'parameters' ] ) ; unset ( $ services [ 'imports' ] ) ; foreach ( $ services as $ name => $ service ) { if ( null === $ service ) { continue ; } if ( ! isset ( $ service [ 'class' ] ) ) { throw InvalidArgumentException :: format ( 'The service "%s" did not specify its "class".' , $ name ) ; } if ( ! isset ( $ service [ 'parameters' ] ) ) { $ service [ 'parameters' ] = array ( ) ; } $ app -> register ( new $ service [ 'class' ] ( ) , $ service [ 'parameters' ] ) ; } }
Registers the configured services.

@param Application $app The application.

@throws InvalidArgumentException If a service definition is invalid.
Registers the configured services .