Passed
Pull Request — master (#1077)
by Maxim
19:13 queued 06:20
created

Proxy   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 3
eloc 3
c 2
b 1
f 0
dl 0
loc 22
ccs 4
cts 6
cp 0.6667
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 3 1
A getInterface() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiral\Core\Config;
6
7
class Proxy extends Binding
8
{
9
    /**
10
     * @param class-string $interface
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...
11
     */
12 5
    public function __construct(
13
        protected readonly string $interface,
14
        public readonly bool $singleton = false,
15
    ) {
16 5
    }
17
18
    public function __toString(): string
19
    {
20
        return \sprintf('Proxy to `%s`', $this->interface);
21
    }
22
23
    /**
24
     * @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...
25
     */
26 4
    public function getInterface(): string
27
    {
28 4
        return $this->interface;
29
    }
30
}
31