Passed
Push — master ( e5da51...3bc160 )
by Peter
02:36
created

Provider::getAdminDateFormat()   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
declare(strict_types=1);
4
5
namespace AbterPhp\Framework\Config;
6
7
use AbterPhp\Framework\Constant\Env;
8
use Opulence\Environments\Environment;
9
10
class Provider
11
{
12
    /**
13
     * @return string
14
     */
15
    public function getProblemBaseUrl(): string
16
    {
17
        return Environment::getVar(Env::API_PROBLEM_BASE_URL);
0 ignored issues
show
Bug Best Practice introduced by
The expression return Opulence\Environm...::API_PROBLEM_BASE_URL) could return the type null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
18
    }
19
20
    /**
21
     * @return string
22
     */
23
    public function getAdminDateFormat(): string
24
    {
25
        return Environment::getVar(Env::ADMIN_DATE_FORMAT);
0 ignored issues
show
Bug Best Practice introduced by
The expression return Opulence\Environm...Env::ADMIN_DATE_FORMAT) could return the type null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
26
    }
27
28
    /**
29
     * @return string
30
     */
31
    public function getAdminDateTimeFormat(): string
32
    {
33
        return Environment::getVar(Env::ADMIN_DATETIME_FORMAT);
0 ignored issues
show
Bug Best Practice introduced by
The expression return Opulence\Environm...:ADMIN_DATETIME_FORMAT) could return the type null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
34
    }
35
36
    /**
37
     * @return bool
38
     */
39
    public function isCacheAllowed(): bool
40
    {
41
        return Environment::getVar(Env::ENV_NAME) === Environment::PRODUCTION;
42
    }
43
}
44