| Total Complexity | 5 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | final class Factory extends Binding |
||
| 11 | { |
||
| 12 | use \Spiral\Core\Exception\Traits\ClosureRendererTrait; |
||
|
|
|||
| 13 | |||
| 14 | public readonly \Closure $factory; |
||
| 15 | private readonly int $parametersCount; |
||
| 16 | private ?string $definition; |
||
| 17 | |||
| 18 | 307 | public function __construct( |
|
| 34 | 307 | }; |
|
| 35 | } |
||
| 36 | |||
| 37 | 294 | public function __toString(): string |
|
| 38 | { |
||
| 39 | 294 | $this->definition ??= $this->renderClosureSignature(new \ReflectionFunction($this->factory)); |
|
| 40 | |||
| 41 | 294 | return \sprintf( |
|
| 42 | 294 | 'Factory from %s', |
|
| 43 | 294 | $this->definition, |
|
| 44 | 294 | ); |
|
| 45 | } |
||
| 46 | |||
| 47 | 307 | public function getParametersCount(): int |
|
| 50 | } |
||
| 51 | } |
||
| 52 |