Passed
Push — master ( 41e710...91ffae )
by Aleksei
06:19 queued 21s
created

Shared::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 0
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiral\Core\Config;
6
7
/**
8
 * Static permanent object
9
 */
10
final class Shared extends Binding
11
{
12 1078
    public function __construct(
13
        public readonly object $value,
14
        public readonly bool $singleton = false,
15 1078
    ) {}
16
17
    public function __toString(): string
18
    {
19
        return 'Shared object of class ' . $this->value::class;
20
    }
21
22
    /**
23
     * @return class-string
0 ignored issues
show
Documentation Bug introduced by
The doc comment class-string at position 0 could not be parsed: Unknown type name 'class-string' at position 0 in class-string.
Loading history...
24
     * @internal
25
     */
26 911
    public function getReturnClass(): string
27
    {
28 911
        return $this->value::class;
29
    }
30
}
31