| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace WPDeveloper\BetterDocs\Dependencies\DI\Definition\Source; |
| 6 |
|
| 7 |
use WPDeveloper\BetterDocs\Dependencies\DI\Definition\Exception\InvalidDefinition; |
| 8 |
use WPDeveloper\BetterDocs\Dependencies\DI\Definition\ObjectDefinition; |
| 9 |
|
| 10 |
/** |
| 11 |
* Implementation used when autowiring is completely disabled. |
| 12 |
* |
| 13 |
* @author Matthieu Napoli <matthieu@mnapoli.fr> |
| 14 |
*/ |
| 15 |
class NoAutowiring implements Autowiring |
| 16 |
{ |
| 17 |
public function autowire(string $name, ObjectDefinition $definition = null) |
| 18 |
{ |
| 19 |
throw new InvalidDefinition(sprintf( |
| 20 |
'Cannot autowire entry "%s" because autowiring is disabled', |
| 21 |
$name |
| 22 |
)); |
| 23 |
} |
| 24 |
} |
| 25 |
|