# wpide/3.5.9/vendor/league/flysystem/src/ConfigAwareTrait.php

WPIDE – File Manager &amp; Code Editor, version 3.5.9. 50 lines.

- Page: https://pluginprobe.com/plugins/wpide/3.5.9/code/vendor/league/flysystem/src/ConfigAwareTrait.php
- Raw: https://pluginprobe.com/plugins/wpide/3.5.9/raw/vendor/league/flysystem/src/ConfigAwareTrait.php
- Modified: 2022-07-30T20:33:10+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wpide/3.5.9/code/vendor/league/flysystem/src/ConfigAwareTrait.php#L10-L20`.

```php
<?php

namespace League\Flysystem;

/**
 * @internal
 */
trait ConfigAwareTrait
{
    /**
     * @var Config
     */
    protected $config;

    /**
     * Set the config.
     *
     * @param Config|array|null $config
     */
    protected function setConfig($config)
    {
        $this->config = $config ? Util::ensureConfig($config) : new Config;
    }

    /**
     * Get the Config.
     *
     * @return Config config object
     */
    public function getConfig()
    {
        return $this->config;
    }

    /**
     * Convert a config array to a Config object with the correct fallback.
     *
     * @param array $config
     *
     * @return Config
     */
    protected function prepareConfig(array $config)
    {
        $config = new Config($config);
        $config->setFallback($this->getConfig());

        return $config;
    }
}

```
