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.
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.