AppResource::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 1
dl 0
loc 2
ccs 0
cts 1
cp 0
crap 2
rs 10
c 0
b 0
f 0
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