LinkerFacadeTrait::autoload()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * This file is part of Railt package.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace Railt\SDL\Compiler;
13
14
use Railt\SDL\Backend\Linker\LinkerInterface;
15
use Railt\SDL\Backend\Linker\Registry;
16
17
/**
18
 * Trait LinkerFacadeTrait
19
 */
20
trait LinkerFacadeTrait
21
{
22
    /**
23
     * @var LinkerInterface
24
     */
25
    protected LinkerInterface $linker;
26
27
    /**
28
     * @return void
29
     */
30
    private function bootLinkerFacadeTrait(): void
31
    {
32
        $this->linker = new Registry();
33
    }
34
35
    /**
36
     * {@inheritDoc}
37
     */
38
    public function autoload(callable $loader): LinkerInterface
39
    {
40
        return $this->linker->autoload($loader);
41
    }
42
43
    /**
44
     * @return LinkerInterface
45
     */
46
    public function getLinker(): LinkerInterface
47
    {
48
        return $this->linker;
49
    }
50
51
    /**
52
     * {@inheritDoc}
53
     */
54
    public function cancelAutoload(callable $loader): LinkerInterface
55
    {
56
        return $this->linker->cancelAutoload($loader);
57
    }
58
59
    /**
60
     * {@inheritDoc}
61
     */
62
    public function getAutoloaders(): iterable
63
    {
64
        return $this->linker->getAutoloaders();
65
    }
66
}
67