@param ContainerInterface $container

@return string

@throws ContainerExceptionInterface
@throws NotFoundExceptionInterface
172623
private function getCommandsFolder(ContainerInterface $container): string
    {
        assert($container->has(CacheSettingsProviderInterface::class));

        /** @var CacheSettingsProviderInterface $provider */
        $provider  = $container->get(CacheSettingsProviderInterface::class);
        $appConfig = $provider->getApplicationConfiguration();
        $folder    = $appConfig[S::KEY_COMMANDS_FOLDER];

        return $folder;
    }
764866
protected static function getSessionSettings(ContainerInterface $container): array
    {
        /** @var SettingsProviderInterface $provider */
        $provider = $container->get(SettingsProviderInterface::class);
        $settings = $provider->get(C::class);

        return $settings;
    }
862466
public function handleDependencies(DependencyContainerInterface $container): DependencyContainerInterface
    {
        $container = $this->addShellFacade($container);
        $container = $this->addCommandList($container);

        return $container;
    }
249944
protected function mapDefaultContainerParams(ContainerInterface $container): ContainerInterface
    {
        /** @var \SprykerEco\Zed\Payone\Business\Api\Request\Container\AbstractRequestContainer $container */
        $container->setMid($this->standardParameters->getMid());
        $container->setAid($this->standardParameters->getAid());
        $container->setPortalid($this->standardParameters->getPortalId());
        $container->setKey(md5($this->standardParameters->getKey()));
        $container->setMode($this->modeDetector->getMode());
        $container->setIntegratorName(PayoneApiConstants::INTEGRATOR_NAME_SPRYKER);
        $container->setIntegratorVersion(PayoneApiConstants::INTEGRATOR_VERSION_3_0_0);
        $container->setSolutionName(PayoneApiConstants::SOLUTION_NAME_SPRYKER);
        $container->setSolutionVersion(PayoneApiConstants::SOLUTION_VERSION_3_0_0);

        return $container;
    }
1316275
private function getMigrations(ContainerInterface $container): Generator
    {
        $connection = $this->getConnection($container);
        $manager    = $connection->getSchemaManager();

        if ($manager->tablesExist([static::MIGRATIONS_TABLE]) === true) {
            $migrated = $this->readMigrated($connection);
        } else {
            $this->createMigrationsTable($manager);
            $migrated = [];
        }

        $notYetMigrated = array_diff($this->getMigrationClasses(), $migrated);

        foreach ($notYetMigrated as $class) {
            yield $class;
            $this->saveMigration($connection, $class);
        }
    }
819383
public function install(ContainerInterface $container)
    {
        // david factory
        $container['david'] = function(){
            $component = new Person('David Smith',24,179.2,function($target){ return 'throws '.$target.'.'; });
            $component->smile();
            return $component;
        };
        $container->slot('david')->lock()->mustBeTypeOf('object')->mustBeInstanceOf('\Sample\PersonInterface');
        // david's car factory
        $container['david\'s car'] = function(ContainerInterface $c){
            $component = new Car($c['string.my_model_name'],$c['integer.car_seats_sedan'],true,$c['david'],$c['toyota']);
            $component->moveTo($c['tokyo'],true);
            $component->serial_number = 123456;
            return $component;
        };
        $container->slot('david\'s car')->mustBeTypeOf('object');
    }
147415
private function getRollbacks(ContainerInterface $container): Generator
    {
        $connection = $this->getConnection($container);
        $migrated   = $this->readMigrated($connection);

        foreach (array_reverse($migrated, true) as $index => $class) {
            yield $class;
            $this->removeMigration($connection, $index);
        }
    }
890513
public function loadContextInstancesByContainer(ContainerInterface $container)
    {

        // initialize the array for the context instances
        $contextInstances = array();

        // iterate over all applications and create the context configuration
        foreach (glob($container->getAppBase() . '/*', GLOB_ONLYDIR) as $webappPath) {
            $context = $this->loadContextInstance($container->getContainerNode(), $webappPath);
            $contextInstances[$context->getName()] = $context;
        }

        // return the array with the context instances
        return $contextInstances;
    }
1310312
protected function finish(ContainerInterface $container)
	{
		foreach ($this->getPackages() as $package) {
			$package->finish($container);
		}
	}
35485
protected function containerName($container = null)
    {
        if ($container !== null) {
            return $container;
        }

        $pos = strrpos($this->entity, '\\');
        if ($pos === false) {
            return $this->entity;
        }

        return substr($this->entity, strrpos($this->entity, '\\') + 1);
    }
29573
public function register(ContainerInterface $container)
    {
        if (! isset($container['session'])) {
            $container['session'] = function (ContainerInterface $container) {
                return new Session;
            };
        }

        if (! isset($container['router'])) {
            /**
             * This service MUST return a SHARED instance
             * of Mbh\Interfaces\RouterInterface.
             *
             * @param Container $container
             * @return RouterInterface
             */
            $container['router'] = function (ContainerInterface $container) {
                $routerCacheFile = false;
                if (isset($container->get('settings')['routerCacheFile'])) {
                    $routerCacheFile = $container->get('settings')['routerCacheFile'];
                }

                $router = (new Router)->setCacheFile($routerCacheFile);
                if (method_exists($router, 'setContainer')) {
                    $router->setContainer($container);
                }

                if (method_exists($router, 'setCallableResolver')) {
                    $router->setCallableResolver($container['callableResolver']);
                }

                return $router;
            };
        }
    }
9364
protected function getElementData(
        ContainerInterface $container, &$data = []
    ) {
         foreach ($container as $element) {
             if ($element instanceof InputInterface) {
                 $data[$element->getName()] = $element->getValue();
                 continue;
             }

             if ($element instanceof ContainerInterface) {
                 $this->getElementData($element, $data);
                 continue;
             }
        }
    }
803491
protected function buildCondition(ContainerInterface $container)
    {
        if (!$condition = $container->getCondition()) {
            throw new ContainerException('Condition is empty');
        }

        $suffix = count($this->parameters) + 1;
        $condition->reconfigureParameters($suffix);

        if ($condition->isAggregateFunction()) {
            $where = $this->aggregate($condition);
        } else {
            $where = $condition->buildCondition();
            $this->addParameter($condition->getParameters());
        }
        if (!$where = $this->trimAndOr($where)) {
            return null;
        }

        return sprintf(
            '%s%s',
            $container->getAndOr() ? sprintf(' %s ', $container->getAndOr()) : null,
            $where
        );
    }
1186580
public function buildContainer(Model\ContainerInterface $container)
    {
        // Rendering source (for copy containers)
        $source = is_null($container->getCopy()) ? $container : $container->getCopy();

        $view = new ContainerView();
        $attributes = $view->getAttributes()->addClass('cms-container');
        $attributes->setId('cms-container-' . $container->getId());

        $innerAttributes = $view->getInnerAttributes()->addClass('cms-inner-container');

        if ($this->editor->isEnabled()) {
            $content = $container->getContent();

            // Container
            $attributes
                ->setData([
                    'id'       => $container->getId(),
                    'position' => $container->getPosition(),
                    'type'     => $container->getType(),
                    'actions'  => [
                        'add'         => !is_null($content),
                        'edit'        => true,
                        'layout'      => is_null($container->getCopy()),
                        'change_type' => !$container->isNamed() && !$container->isTitled(),
                        'move_up'     => !$container->isFirst(),
                        'move_down'   => !$container->isLast(),
                        'remove'      => !$container->isAlone(),
                    ],
                ]);

            // Inner container
            $innerAttributes
                ->setId('cms-inner-container-' . $source->getId())
                ->setData([
                    'id' => $source->getId(),
                ]);
        }

        // Layout
        $this->editor->getLayoutAdapter()->buildContainer($source, $view);
        $view->content = '<span class="cms-container-anchor">&nbsp;</span>' . $view->content;


        // Plugin
        $this->editor->getContainerPlugin($source->getType())->render($source, $view);

        // Don't build rows if the plugin did generate a content
        if (0 == strlen($view->innerContent)) {
            foreach ($source->getRows() as $row) {
                $view->rows[] = $this->buildRow($row);
            }
        }

        return $view;
    }
673804
static public function run(ContainerInterface $container)
    {
        $request = ServerRequestFactory::fromGlobals();
        $container->set('Request', $request);
        $response = $container->get('HttpDispatcher')->dispatch($request);

        if (is_null($response)) {
            $controller = new Controller($container);
            $response = new TextResponse('Internal server error. Dispatcher returned null response.', 500);
        }

        (new SapiEmitter())->emit($response);
    }
1339754
protected static function getLoggerIfEnabled(PsrContainerInterface $container): ?LoggerInterface
    {
        $logger   = null;
        $settings = $container->get(SettingsProviderInterface::class)->get(C::class);
        if ($settings[C::KEY_IS_LOG_ENABLED] === true && $container->has(LoggerInterface::class) === true) {
            $logger = $container->get(LoggerInterface::class);
        }

        return $logger;
    }
1056027
public static function get(ContainerInterface $container) {
    $storage_type = $container
      ->get('config.factory')
      ->get('acm.commerce_users')
      ->get('storage_type');

    switch ($storage_type) {
      case 'database_store':
        $storage = $container
          ->get('acm.database_session_store')
          ->get('acm');
        break;

      default:
        $storage = $container
          ->get('acm.php_session_store');
        break;
    }

    return $storage;
  }