Completed
Push — master ( fc356f...dd7510 )
by Antonio Carlos
02:17
created

Config::getAuth()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 2
eloc 4
nc 2
nop 0
1
<?php
2
3
namespace PragmaRX\Google2FALaravel\Support;
4
5
trait Config
6
{
7
    /**
8
     * Get a config value.
9
     *
10
     * @param $string
11
     * @param array $children
12
     *
13
     * @throws \Exception
14
     *
15
     * @return mixed
16
     */
17
    protected function config($string, $children = [])
18
    {
19
        if (is_null(config(Constants::CONFIG_PACKAGE_NAME))) {
20
            throw new \Exception('Config not found');
21
        }
22
23
        return config(
24
            implode('.', array_merge([Constants::CONFIG_PACKAGE_NAME, $string], (array) $children))
25
        );
26
    }
27
}
28