View file vendor/php-di/php-di/src/Definition/Source/NoAutowiring.php

File size: 558B
<?php

declare(strict_types=1);

namespace DI\Definition\Source;

use DI\Definition\Exception\InvalidDefinition;
use DI\Definition\ObjectDefinition;

/**
 * Implementation used when autowiring is completely disabled.
 *
 * @author Matthieu Napoli <[email protected]>
 */
class NoAutowiring implements Autowiring
{
    public function autowire(string $name, ObjectDefinition $definition = null)
    {
        throw new InvalidDefinition(sprintf(
            'Cannot autowire entry "%s" because autowiring is disabled',
            $name
        ));
    }
}