Get('settings') vs use ($settings)

Just wondering if there is anything I should know about these two.
Is there one to avoid or are both equally accepted and just a matter of personel preference?

$container[‘view’] = function ($container) {
$settings = $c->get(‘settings’);
$view = new \Slim\Views\Twig($settings[‘view’][‘template_path’], $settings[‘view’][‘twig’]);
return $view;

$container[‘view’] = function ($container) use ($settings) {
$view = new \Slim\Views\Twig($settings[‘settings’][‘view’][‘template_path’], $settings[‘settings’][‘view’][‘twig’]);
return $view;

The second method will only work if the $settings variable is in scope.

Unless you have a reason not to use the settings stored in the container, I would go for the first option: retrieve the settings from the container.

Thank you for the explanation.