Passed
Push — master ( d89542...5cf388 )
by Nils
06:27
created

MiscModel::getBrowserExtensionSettings()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 10
rs 10
c 1
b 0
f 0
1
<?php
2
/**
3
 * Teampass - a collaborative passwords manager.
4
 * ---
5
 * This library is distributed in the hope that it will be useful,
6
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
8
 * ---
9
 *
10
 * @project   Teampass
11
 * @version    API
12
 *
13
 * @file      MiscModel.php
14
 * ---
15
 *
16
 * @author    Nils Laumaillé ([email protected])
17
 *
18
 * @copyright 2009-2025 Teampass.net
19
 *
20
 * @license   https://spdx.org/licenses/GPL-3.0-only.html#licenseText GPL-3.0
21
 * ---
22
 *
23
 * @see       https://www.teampass.net
24
 */
25
26
use TeampassClasses\ConfigManager\ConfigManager;
27
28
class MiscModel
29
{
30
    // Get extension settings
31
    public function getBrowserExtensionSettings(): array
32
    {
33
        // Load config
34
        $configManager = new ConfigManager();
35
        $SETTINGS = $configManager->getAllSettings();
36
37
        return [
38
            'extension_fqdn' => $SETTINGS['browser_extension_fqdn'] ?? '',
39
            'extension_key' => $SETTINGS['browser_extension_key'] ?? '',
40
            'extension_url' => $SETTINGS['cpassman_url'] ?? '',
41
        ];
42
    }
43
}