Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Celema\Wire; |
| 6 | |
| 7 | use Psr\Container\ContainerInterface as Container; |
| 8 | |
| 9 | /** @psalm-api */ |
| 10 | interface CreatorInterface |
| 11 | { |
| 12 | /** |
| 13 | * Invokes the constructor of `$class` or the specified factory method. |
| 14 | * The container is only consulted for its parameters, never for `$class` |
| 15 | * itself. A constructor produces a new instance; a factory controls |
| 16 | * whether its result is new or reused. |
| 17 | * |
| 18 | * @param class-string $class |
| 19 | */ |
| 20 | public function create( |
| 21 | string $class, |
| 22 | array $predefinedArgs = [], |
| 23 | array $predefinedTypes = [], |
| 24 | ?callable $injectCallback = null, |
| 25 | string $constructor = '', |
| 26 | ): object; |
| 27 | |
| 28 | /** |
| 29 | * Returns the container's entry when `$id` is registered, so the entry's |
| 30 | * lifetime and configuration apply. Otherwise builds a new instance like |
| 31 | * `create()`. |
| 32 | */ |
| 33 | public function resolve( |
| 34 | string $id, |
| 35 | array $predefinedTypes = [], |
| 36 | ?callable $injectCallback = null, |
| 37 | ): object; |
| 38 | |
| 39 | public function container(): ?Container; |
| 40 | } |