AppResource   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 20
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A isFresh() 0 3 1
A __toString() 0 3 1
1
<?php declare(strict_types=1);
2
3
/*
4
 * This file is part of Biurad opensource projects.
5
 *
6
 * @copyright 2019 Biurad Group (https://biurad.com/)
7
 * @license   https://opensource.org/licenses/BSD-3-Clause License
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace Flange\Debug;
14
15
use Symfony\Component\Config\Resource\SelfCheckingResourceInterface;
16
17
class AppResource implements SelfCheckingResourceInterface
18
{
19
    public function __construct(private string $resource = \PHP_VERSION_ID.\PHP_SAPI.\PHP_OS)
20
    {
21
    }
22
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function __toString(): string
27
    {
28
        return __CLASS__;
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function isFresh(int $timestamp): bool
35
    {
36
        return $this->resource === \PHP_VERSION_ID.\PHP_SAPI.\PHP_OS;
37
    }
38
}
39