@@ 34-60 (lines=27) @@ | ||
31 | Repository $config |
|
32 | ) { |
|
33 | /* @var Addon $addon */ |
|
34 | foreach ($addons->withConfig('settings') as $addon) { |
|
35 | foreach ($config->get($addon->getNamespace('settings')) as $key => $setting) { |
|
36 | ||
37 | if (isset($setting['env']) && env($setting['env']) !== null) { |
|
38 | continue; |
|
39 | } |
|
40 | ||
41 | if (!isset($setting['bind'])) { |
|
42 | continue; |
|
43 | } |
|
44 | ||
45 | $default = array_get($setting, 'config.default_value'); |
|
46 | ||
47 | if (!$settings->has($key = $addon->getNamespace($key)) && !$default) { |
|
48 | continue; |
|
49 | } |
|
50 | ||
51 | if ($presenter = $settings->presenter($key)) { |
|
52 | ||
53 | $config->set($setting['bind'], $presenter->__value()); |
|
54 | ||
55 | continue; |
|
56 | } |
|
57 | ||
58 | $config->set($setting['bind'], $evaluator->evaluate($default)); |
|
59 | } |
|
60 | } |
|
61 | ||
62 | foreach ($addons->withConfig('settings/settings') as $addon) { |
|
63 | foreach ($config->get($addon->getNamespace('settings/settings')) as $key => $setting) { |
|
@@ 62-88 (lines=27) @@ | ||
59 | } |
|
60 | } |
|
61 | ||
62 | foreach ($addons->withConfig('settings/settings') as $addon) { |
|
63 | foreach ($config->get($addon->getNamespace('settings/settings')) as $key => $setting) { |
|
64 | ||
65 | if (isset($setting['env']) && env($setting['env']) !== null) { |
|
66 | continue; |
|
67 | } |
|
68 | ||
69 | if (!isset($setting['bind'])) { |
|
70 | continue; |
|
71 | } |
|
72 | ||
73 | $default = array_get($setting, 'config.default_value'); |
|
74 | ||
75 | if (!$settings->has($key = $addon->getNamespace($key)) && !$default) { |
|
76 | continue; |
|
77 | } |
|
78 | ||
79 | if ($presenter = $settings->presenter($key)) { |
|
80 | ||
81 | $config->set($setting['bind'], $presenter->__value()); |
|
82 | ||
83 | continue; |
|
84 | } |
|
85 | ||
86 | $config->set($setting['bind'], $evaluator->evaluate($default)); |
|
87 | } |
|
88 | } |
|
89 | ||
90 | foreach ($config->get('streams::settings/settings', []) as $key => $setting) { |
|
91 |