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

PackageConfig::shouldRunMigrations()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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