Code Duplication    Length = 12-12 lines in 2 locations

htdocs/xoops_lib/Xoops/Core/Assets.php 1 location

@@ 173-184 (lines=12) @@
170
     *
171
     * @return void
172
     */
173
    protected function saveAssetsPrefs($assets_prefs)
174
    {
175
        if (is_array($assets_prefs)) {
176
            $xoops = \Xoops::getInstance();
177
            try {
178
                Yaml::save($assets_prefs, $xoops->path($this->assetsPrefsFilename));
179
                $xoops->cache()->write($this->assetsPrefsCacheKey, $assets_prefs);
180
            } catch (\Exception $e) {
181
                $xoops->events()->triggerEvent('core.exception', $e);
182
            }
183
        }
184
    }
185
186
187
    /**

htdocs/xoops_lib/Xoops/Core/Service/Manager.php 1 location

@@ 162-173 (lines=12) @@
159
     *
160
     * @return void
161
     */
162
    protected function saveProviderPrefs($providerPrefs)
163
    {
164
        if (is_array($providerPrefs)) {
165
            $xoops = \Xoops::getInstance();
166
            try {
167
                Yaml::save($providerPrefs, $xoops->path($this->providerPrefsFilename));
168
                $xoops->cache()->write($this->providerPrefsCacheKey, $providerPrefs);
169
            } catch (\Exception $e) {
170
                $xoops->events()->triggerEvent('core.exception', $e);
171
            }
172
        }
173
    }
174
175
    /**
176
     * saveChoice - record priority choices for service providers