@param Settings $settings

@return Adapters\AwsS3
544160
protected function awsS3(Settings $settings)
    {
        return new Adapters\AwsS3(
            new AwsS3Adapter(
                new S3Client([
                    'credentials' => [
                        'key'    => $settings->get('awsS3Key'),
                        'secret' => $settings->get('awsS3Secret'),
                    ],
                    'region'  => empty($settings->get('awsS3Region')) ? null : $settings->get('awsS3Region'),
                    'version' => 'latest',
                ]),
                $settings->get('awsS3Bucket')
            )
        );
    }
246662
public static function getInstance(array $settings = []): DIInterface
    {
        if (! self::$instance) {
            self::$instance = new DI($settings);
        }
        
        return self::$instance;
    }
721382
public function loadSettings(array $settings)
    {
        $relationalManagerKey = $this->getOption(static::RELATIONAL_MANAGER_KEY);
        if (array_key_exists($relationalManagerKey, $settings)) {
            $this->registerEntityManagers((array) $settings[$relationalManagerKey]);
        }

        $mongoDBManagerKey = $this->getOption(static::MONGODB_MANAGER_KEY);
        if (array_key_exists($mongoDBManagerKey, $settings)) {
            $this->registerMongoDBDocumentManagers((array) $settings[$mongoDBManagerKey]);
        }

        $couchDBManagerKey = $this->getOption(static::COUCHDB_MANAGER_KEY);
        if (array_key_exists($couchDBManagerKey, $settings)) {
            $this->registerCouchDBDocumentManagers((array) $settings[$couchDBManagerKey]);
        }

        return $this;
    }
749937
public static function mergeWithDefaultSettings($settings)
    {
        if (empty($settings)) {
            return static::getDefaultSettings();
        }
        if (is_array($settings)) {
            return array_merge(static::getDefaultSettings(), $settings);
        }
        throw new Exception("Argument must be an array.");
    }
801645
private function applyFilters(array $settings): array
    {
        $where = [];
        foreach ($settings as $column => $filters) {
            foreach ($filters as $filter => $value) {
                if ($filter === Grid\Grid::FILTER_LIKE) {
                    $value = '%' . $value . '%';
                }
                $where[] = $column . ' ' .
                    $this->filters[$filter] . ' ' .
                    Proxy\Db::quote((string)$value);
            }
        }
        return $where;
    }
535147
public function setAttachmentOptions(array $settings)
    {
        $this->attachmentOptions = array_merge(
            $this->defaultAttachmentOptions(),
            $this->parseAttachmentOptions($settings)
        );

        return $this;
    }
1240331
public function getFilesystem($field, array $settings = [])
    {
        $adapter = new Local(Hash::get($settings, 'filesystem.root', ROOT . DS));
        $adapter = Hash::get($settings, 'filesystem.adapter', $adapter);
        if (is_callable($adapter)) {
            $adapter = $adapter();
        }

        if ($adapter instanceof AdapterInterface) {
            return new Filesystem($adapter, Hash::get($settings, 'filesystem.options', [
                'visibility' => AdapterInterface::VISIBILITY_PUBLIC
            ]));
        }

        throw new UnexpectedValueException(sprintf("Invalid Adapter for field %s", $field));
    }
1179044
public function resolve(array $settings = [])
    {
        return new YamlDriver(
            Arr::get($settings, 'paths'),
            Arr::get($settings, 'extension', YamlDriver::DEFAULT_FILE_EXTENSION)
        );
    }
66668
public function setSettings(array $settings)
    {
        $this->settings = array_merge($this->settings, $settings);
        
        if (isset($settings['templates_path'])) {
            $this->view->templatesPath = $this->settings['templates_path'];
        }
        
        return $this;
    }
635531
public static function modules($settings)
    {
        return array_filter(
            array_map(
                function ($m) {
                    return is_array($m) ? key($m) : $m;
                },
                $settings['modules']['enabled'],
                array_keys($settings['modules']['enabled'])
            ),
            function ($m) use ($settings) {
                if (!isset($settings['modules']['disabled'])) {
                    return true;
                }
                return !in_array($m, $settings['modules']['disabled']);
            }
        );
    }
375945
public function formalize(Settings $settings, TransportConnectionFactoryInterface $connectionFactory)
    {
        $durableMessagingEnabled = $this->isDurableMessagingEnabled($settings);
        /** @var AMQPConnection $connection */
        $connection = $connectionFactory->createConnection();
        return new RabbitMqTransportInfrastructure(
            $settings,
            new RoutingTopology($durableMessagingEnabled),
            new BrokerModel($connection),
            $durableMessagingEnabled
        );
    }
726803
public function pluginW3tc($settings)
    {
        if (empty($settings)) {
            return;
        }

        $available = [
            'remove_comment', 'remove_meta_box',
        ];

        // Special case
        if (is_bool($settings) && $settings) {
            $settings = $available;
        }

        foreach ($settings as $key) {
            $key = strtolower($key);

            if (!in_array($key, $available)) {
                continue;
            }

            if ('remove_comment' === $key) {
                add_filter('w3tc_can_print_comment', '__return_false', 10, 1);
                continue;
            }

            if ('remove_meta_box' === $key && OL_ZEUS_ISADMIN) {
                add_action('wp_dashboard_setup', function () {
                    remove_meta_box('w3tc_latest', 'dashboard', 'normal');
                });

                continue;
            }
        }
    }
451225
public function make(Settings $settings) : string
    {
        $cacheKey = $this->getCacheKey($settings);

        if ($this->hasCachedData($cacheKey)) {
            return $this->getCachedData($cacheKey);
        }

        $settings->hasRequiredSettings();

        return $this->cacheData($cacheKey, $this->createOutput($settings));
    }
30820
protected function addResource(ResourceSettings $settings)
    {
        $settings = $this->prepareResourceSettings($settings);

        if ($settings === null) {
            return false;
        }

        return $settings->url === null && $this->mergeResources && $settings->compile
            ? $this->addLocalResource($settings)
            : $this->addRemoteResource($settings);
    }
674275
public function saveSettings($settings)
    {
        if (isset($settings['name']) && isset($this->config['servers'][$settings['name']])) {
            return $this->saveConfig(array_merge($this->config['servers'][$settings['name']], $settings));
        }
    }
1070478
public function setSettings( $settings )
    {
        if ( ! empty( $settings ) )
        {
            foreach ( $settings as $name => $value )
            {
                $this->setSetting( $name, $value );
            }
        }

        return $this;
    }
1029240
private function setSettings($settings)
    {
        if ($settings) {
            foreach ($this->settings as $key => &$value) {
                if (!empty($settings->{$key}) && $settings->{$key}) {
                    $value = $settings->{$key};
                }
            }
        }
    }