Code Duplication    Length = 12-12 lines in 2 locations

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

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

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