Autowire::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 2
nc 2
nop 1
dl 0
loc 4
rs 10
c 1
b 0
f 0
1
<?php
2
3
/**
4
 * This file is part of di
5
 *
6
 * For the full copyright and license information, please view the LICENSE.md
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace Slick\Di\Definition\Attributes;
13
14
use Attribute;
15
16
/**
17
 * Autowire
18
 *
19
 * @package Slick\Di\Definition\Attributes
20
 */
21
#[Attribute(Attribute::TARGET_METHOD)]
22
final class Autowire
23
{
24
    private array $services = [];
25
26
    public function __construct(...$services)
27
    {
28
        foreach ($services as $service) {
29
            $this->services[] = "@$service";
30
        }
31
    }
32
33
    public function services(): array
34
    {
35
        return $this->services;
36
    }
37
}
38