Issues (101)

src/di/InjectorInterface.php (2 issues)

1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ray\Di;
6
7
/**
8
 * Builds the graphs of objects that make up your application
9
 *
10
 * The injector tracks the dependencies for each type and uses bindings to inject them.
11
 * This is the core of Ray.Di, although you rarely interact with it directly.
12
 * This "behind-the-scenes" operation is what distinguishes dependency injection from its cousin, the service locator pattern.
13
 */
14
interface InjectorInterface
15
{
16
    /**
17
     * Return object graph
18
     *
19
     * @param ''|class-string<T> $interface
0 ignored issues
show
Documentation Bug introduced by
The doc comment ''|class-string<T> at position 0 could not be parsed: Unknown type name '''' at position 0 in ''|class-string<T>.
Loading history...
20
     * @param string             $name
21
     *
22
     * @return ($interface is '' ? mixed : T)
0 ignored issues
show
Documentation Bug introduced by
The doc comment ($interface at position 1 could not be parsed: Unknown type name '$interface' at position 1 in ($interface.
Loading history...
23
     *
24
     * @template T of object
25
     */
26
    public function getInstance($interface, $name = Name::ANY);
27
}
28