PluginProbe
WPIDE – File Manager & Code Editor / 3.5.9
WPIDE – File Manager & Code Editor v3.5.9
3.5.9 3.5.8 3.5.7 2.0.14 2.0.15 2.0.16 2.0.2 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1 2.2 2.3 2.3.1 2.3.2 2.4.0 2.5 2.6 3.0 3.1 3.2 3.3 All 55 releases
wpide / vendor / league / flysystem / src / ConfigAwareTrait.php

ConfigAwareTrait.php in WPIDE – File Manager & Code Editor 3.5.9, at vendor/league/flysystem/src/ConfigAwareTrait.php

50 lines 851 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace League\Flysystem;
4
5 /**
6 * @internal
7 */
8 trait ConfigAwareTrait
9 {
10 /**
11 * @var Config
12 */
13 protected $config;
14
15 /**
16 * Set the config.
17 *
18 * @param Config|array|null $config
19 */
20 protected function setConfig($config)
21 {
22 $this->config = $config ? Util::ensureConfig($config) : new Config;
23 }
24
25 /**
26 * Get the Config.
27 *
28 * @return Config config object
29 */
30 public function getConfig()
31 {
32 return $this->config;
33 }
34
35 /**
36 * Convert a config array to a Config object with the correct fallback.
37 *
38 * @param array $config
39 *
40 * @return Config
41 */
42 protected function prepareConfig(array $config)
43 {
44 $config = new Config($config);
45 $config->setFallback($this->getConfig());
46
47 return $config;
48 }
49 }
50