Passed
Push — master ( ad0842...d9b491 )
by Gabriel
11:57 queued 14s
created

PackageConfig   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 18
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A databaseConnection() 0 3 1
A shouldRunMigrations() 0 3 1
1
<?php
2
3
namespace ByTIC\Payments\Utility;
4
5
use ByTIC\Payments\PaymentsServiceProvider;
6
use Exception;
7
use Nip\Utility\Traits\SingletonTrait;
8
9
/**
10
 *
11
 */
12
class PackageConfig extends \ByTIC\PackageBase\Utility\PackageConfig
13
{
14
    use SingletonTrait;
15
16
    protected $name = PaymentsServiceProvider::NAME;
17
18
    /**
19
     * @return string|null
20
     * @throws Exception
21
     */
22
    public static function databaseConnection(): ?string
23
    {
24
        return (string)static::instance()->get('database.connection');
25
    }
26
27
    public static function shouldRunMigrations(): bool
28
    {
29
        return static::instance()->get('database.migrations', false) !== false;
30
    }
31
}
32