Total Complexity | 5 |
Total Lines | 74 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | class ApplicationInfo |
||
17 | { |
||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | private $appName; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | private $environment; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | private $hash; |
||
32 | |||
33 | /** |
||
34 | * @var bool |
||
35 | */ |
||
36 | private $debug; |
||
37 | |||
38 | /** |
||
39 | * @param string $appName |
||
40 | * @param string $environment |
||
41 | * @param string $hash |
||
42 | * @param bool $debug |
||
43 | */ |
||
44 | public function __construct(string $appName, string $environment, string $hash, bool $debug) |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * Returns the application name. |
||
54 | * |
||
55 | * @return string |
||
56 | */ |
||
57 | public function getAppName(): string |
||
58 | { |
||
59 | return $this->appName; |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * Returns the environment, e.g. development, production, etc. |
||
64 | * |
||
65 | * @return string |
||
66 | */ |
||
67 | public function getEnvironment(): string |
||
68 | { |
||
69 | return $this->environment; |
||
70 | } |
||
71 | |||
72 | /** |
||
73 | * Returns some arbitrary hash to find out which version is live, for example a git hash, composer version.... |
||
74 | * |
||
75 | * @return string |
||
76 | */ |
||
77 | public function getHash(): string |
||
78 | { |
||
79 | return $this->hash; |
||
80 | } |
||
81 | |||
82 | /** |
||
83 | * Returns true if debug mode is on. |
||
84 | * |
||
85 | * @return bool |
||
86 | */ |
||
87 | public function isDebug(): bool |
||
90 | } |
||
91 | } |
||
92 |