PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.12.4
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.12.4
3.13.3 3.13.2 3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 All 261 releases
wpfunnels / vendor / league / flysystem / src / Config.php

Config.php in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 3.12.4, at vendor/league/flysystem/src/Config.php

58 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace League\Flysystem;
6
7 use function array_diff_key;
8 use function array_flip;
9 use function array_merge;
10
11 class Config
12 {
13 public const OPTION_COPY_IDENTICAL_PATH = 'copy_destination_same_as_source';
14 public const OPTION_MOVE_IDENTICAL_PATH = 'move_destination_same_as_source';
15 public const OPTION_VISIBILITY = 'visibility';
16 public const OPTION_DIRECTORY_VISIBILITY = 'directory_visibility';
17 public const OPTION_RETAIN_VISIBILITY = 'retain_visibility';
18
19 public function __construct(private array $options = [])
20 {
21 }
22
23 /**
24 * @param mixed $default
25 *
26 * @return mixed
27 */
28 public function get(string $property, $default = null)
29 {
30 return $this->options[$property] ?? $default;
31 }
32
33 public function extend(array $options): Config
34 {
35 return new Config(array_merge($this->options, $options));
36 }
37
38 public function withDefaults(array $defaults): Config
39 {
40 return new Config($this->options + $defaults);
41 }
42
43 public function toArray(): array
44 {
45 return $this->options;
46 }
47
48 public function withSetting(string $property, mixed $setting): Config
49 {
50 return $this->extend([$property => $setting]);
51 }
52
53 public function withoutSettings(string ...$settings): Config
54 {
55 return new Config(array_diff_key($this->options, array_flip($settings)));
56 }
57 }
58