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

Provider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isCacheAllowed() 0 3 1
A getAdminDateFormat() 0 3 1
A getProblemBaseUrl() 0 3 1
A getAdminDateTimeFormat() 0 3 1
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