How to use objects created in dependency file in same file itself

How to use objects created in dependency file in same file itself
for example :

// DIC configuration

$container = $app->getContainer();

//slimsession
$container[‘session’] = function ($c) {
return new \SlimSession\Helper();
};

$container[‘customerdb’] = function ($c) {
$settings = $c->get(‘settings’)[‘db’];
$dbprefix = $app->session->get(‘user_companies_customer_id’);
$custdb = $dbprefix.$settings[‘cdatabase’];
return new Dabble\Database($settings[‘chost’],$settings[‘cusername’],$settings[‘cpassword’],$custdb);
};

like as shown in above example

Do you mean using the session object? That would be:

$container['customerdb'] = function($container) {
    $session = $container->get('session');
    // ...
};

Thanks for your reply will try this.