| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace WPDeveloper\BetterDocs\Dependencies\DI\Definition\Resolver; |
| 6 |
|
| 7 |
use WPDeveloper\BetterDocs\Dependencies\DI\Definition\Definition; |
| 8 |
use WPDeveloper\BetterDocs\Dependencies\DI\Definition\Exception\InvalidDefinition; |
| 9 |
|
| 10 |
/** |
| 11 |
* Resolves a definition to a value. |
| 12 |
* |
| 13 |
* @since 4.0 |
| 14 |
* @author Matthieu Napoli <matthieu@mnapoli.fr> |
| 15 |
*/ |
| 16 |
interface DefinitionResolver |
| 17 |
{ |
| 18 |
/** |
| 19 |
* Resolve a definition to a value. |
| 20 |
* |
| 21 |
* @param Definition $definition Object that defines how the value should be obtained. |
| 22 |
* @param array $parameters Optional parameters to use to build the entry. |
| 23 |
* |
| 24 |
* @throws InvalidDefinition If the definition cannot be resolved. |
| 25 |
* |
| 26 |
* @return mixed Value obtained from the definition. |
| 27 |
*/ |
| 28 |
public function resolve(Definition $definition, array $parameters = []); |
| 29 |
|
| 30 |
/** |
| 31 |
* Check if a definition can be resolved. |
| 32 |
* |
| 33 |
* @param Definition $definition Object that defines how the value should be obtained. |
| 34 |
* @param array $parameters Optional parameters to use to build the entry. |
| 35 |
* |
| 36 |
* @return bool |
| 37 |
*/ |
| 38 |
public function isResolvable(Definition $definition, array $parameters = []) : bool; |
| 39 |
} |
| 40 |
|