@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | use Anomaly\SettingsModule\Setting\Contract\SettingInterface; |
4 | 4 | use Anomaly\Streams\Platform\Addon\FieldType\FieldType; |
5 | -use Anomaly\Streams\Platform\Addon\FieldType\FieldTypeCollection; |
|
6 | 5 | use Illuminate\Contracts\Bus\SelfHandling; |
7 | 6 | use Illuminate\Foundation\Bus\DispatchesJobs; |
8 | 7 |
@@ -36,8 +36,6 @@ |
||
36 | 36 | * Create a new SettingRepositoryInterface instance. |
37 | 37 | * |
38 | 38 | * @param SettingModel $model |
39 | - * @param Repository $config |
|
40 | - * @param FieldTypeCollection $fieldTypes |
|
41 | 39 | */ |
42 | 40 | public function __construct(SettingModel $model) |
43 | 41 | { |
@@ -146,6 +146,6 @@ |
||
146 | 146 | */ |
147 | 147 | public function findAllByNamespace($namespace) |
148 | 148 | { |
149 | - return $this->model->where('key', 'LIKE', $namespace . '%')->get(); |
|
149 | + return $this->model->where('key', 'LIKE', $namespace.'%')->get(); |
|
150 | 150 | } |
151 | 151 | } |
@@ -27,13 +27,13 @@ |
||
27 | 27 | return [ |
28 | 28 | new \Twig_SimpleFunction( |
29 | 29 | 'setting_value', |
30 | - function ($key, $default = null) { |
|
30 | + function($key, $default = null) { |
|
31 | 31 | return $this->dispatch(new GetSettingValue($key, $default)); |
32 | 32 | } |
33 | 33 | ), |
34 | 34 | new \Twig_SimpleFunction( |
35 | 35 | 'setting', |
36 | - function ($key) { |
|
36 | + function($key) { |
|
37 | 37 | return (new Decorator())->decorate($this->dispatch(new GetSettingValueFieldType($key))); |
38 | 38 | } |
39 | 39 | ) |
@@ -74,12 +74,12 @@ |
||
74 | 74 | { |
75 | 75 | $form = $builder->getForm(); |
76 | 76 | |
77 | - $namespace = $form->getEntry() . '::'; |
|
77 | + $namespace = $form->getEntry().'::'; |
|
78 | 78 | |
79 | 79 | /* @var FieldType $field */ |
80 | 80 | foreach ($form->getFields() as $field) { |
81 | 81 | |
82 | - $key = $namespace . $field->getField(); |
|
82 | + $key = $namespace.$field->getField(); |
|
83 | 83 | $value = $form->getValue($field->getInputName()); |
84 | 84 | |
85 | 85 | $this->settings->set($key, $value); |
@@ -93,7 +93,7 @@ |
||
93 | 93 | continue; |
94 | 94 | } |
95 | 95 | |
96 | - if (!$settings->has($key = 'streams::' . $key)) { |
|
96 | + if (!$settings->has($key = 'streams::'.$key)) { |
|
97 | 97 | continue; |
98 | 98 | } |
99 | 99 |
@@ -39,17 +39,17 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function handle(SettingFormBuilder $builder, SettingRepositoryInterface $settings) |
41 | 41 | { |
42 | - $namespace = $builder->getFormEntry() . '::'; |
|
42 | + $namespace = $builder->getFormEntry().'::'; |
|
43 | 43 | |
44 | 44 | /** |
45 | 45 | * Get the fields from the config system. Sections are |
46 | 46 | * optionally defined the same way. |
47 | 47 | */ |
48 | - if (!$fields = $this->config->get($namespace . 'settings/settings')) { |
|
49 | - $fields = $fields = $this->config->get($namespace . 'settings', []); |
|
48 | + if (!$fields = $this->config->get($namespace.'settings/settings')) { |
|
49 | + $fields = $fields = $this->config->get($namespace.'settings', []); |
|
50 | 50 | } |
51 | 51 | |
52 | - if ($sections = $this->config->get($namespace . 'settings/sections')) { |
|
52 | + if ($sections = $this->config->get($namespace.'settings/sections')) { |
|
53 | 53 | $builder->setSections($sections); |
54 | 54 | } |
55 | 55 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $label = array_get( |
78 | 78 | $field, |
79 | 79 | 'label', |
80 | - $namespace . 'setting.' . $slug . '.label' |
|
80 | + $namespace.'setting.'.$slug.'.label' |
|
81 | 81 | ) |
82 | 82 | ) |
83 | 83 | ) { |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $field['label'] = array_get( |
89 | 89 | $field, |
90 | 90 | 'label', |
91 | - $namespace . 'setting.' . $slug . '.name' |
|
91 | + $namespace.'setting.'.$slug.'.name' |
|
92 | 92 | ); |
93 | 93 | |
94 | 94 | // Default the warning. |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $warning = array_get( |
97 | 97 | $field, |
98 | 98 | 'warning', |
99 | - $namespace . 'setting.' . $slug . '.warning' |
|
99 | + $namespace.'setting.'.$slug.'.warning' |
|
100 | 100 | ) |
101 | 101 | ) |
102 | 102 | ) { |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $placeholder = array_get( |
109 | 109 | $field, |
110 | 110 | 'placeholder', |
111 | - $namespace . 'setting.' . $slug . '.placeholder' |
|
111 | + $namespace.'setting.'.$slug.'.placeholder' |
|
112 | 112 | ) |
113 | 113 | ) |
114 | 114 | ) { |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $instructions = array_get( |
121 | 121 | $field, |
122 | 122 | 'instructions', |
123 | - $namespace . 'setting.' . $slug . '.instructions' |
|
123 | + $namespace.'setting.'.$slug.'.instructions' |
|
124 | 124 | ) |
125 | 125 | ) |
126 | 126 | ) { |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | |
130 | 130 | // Get the value defaulting to the default value. |
131 | 131 | if (!isset($field['value'])) { |
132 | - $field['value'] = $settings->value($namespace . $slug, array_get($field['config'], 'default_value')); |
|
132 | + $field['value'] = $settings->value($namespace.$slug, array_get($field['config'], 'default_value')); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
@@ -45,10 +45,10 @@ |
||
45 | 45 | { |
46 | 46 | list($namespace, $key) = explode('::', $this->key); |
47 | 47 | |
48 | - if (!$fields = $config->get($namespace . '::settings/settings')) { |
|
49 | - $fields = $config->get($namespace . '::settings'); |
|
48 | + if (!$fields = $config->get($namespace.'::settings/settings')) { |
|
49 | + $fields = $config->get($namespace.'::settings'); |
|
50 | 50 | } |
51 | 51 | |
52 | - return $resolver->resolve(array_get($fields, $key . '.config.default_value', null)); |
|
52 | + return $resolver->resolve(array_get($fields, $key.'.config.default_value', null)); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | \ No newline at end of file |