| Total Complexity | 3 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | class ClosureFactory { |
||
| 18 | /** |
||
| 19 | * Factory. |
||
| 20 | * |
||
| 21 | * @var GenericFactory |
||
| 22 | */ |
||
| 23 | protected $factory = null; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Constructor. |
||
| 27 | * |
||
| 28 | * @codeCoverageIgnore |
||
| 29 | * @param GenericFactory $factory |
||
| 30 | */ |
||
| 31 | public function __construct( GenericFactory $factory ) { |
||
| 32 | $this->factory = $factory; |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Make a closure that resolves a value from the container. |
||
| 37 | * |
||
| 38 | * @param string $key |
||
| 39 | * @return Closure |
||
| 40 | */ |
||
| 41 | public function value( $key ) { |
||
| 44 | }; |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Make a closure that resolves a class instance from the container and |
||
| 49 | * calls one of its methods. |
||
| 50 | * Useful if you need to pass a callable to an API without container |
||
| 51 | * support such as the REST API. |
||
| 52 | * |
||
| 53 | * @param string $key |
||
| 54 | * @param string $method |
||
| 55 | * @return Closure |
||
| 56 | */ |
||
| 57 | public function method( $key, $method ) { |
||
| 62 | ); |
||
| 63 | }; |
||
| 66 |