Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
PHP-DI/src/FactoryInterface.php
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
30 lines (27 sloc)
996 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
namespace DI; | |
/** | |
* Describes the basic interface of a factory. | |
* | |
* @api | |
* | |
* @since 4.0 | |
* @author Matthieu Napoli <matthieu@mnapoli.fr> | |
*/ | |
interface FactoryInterface | |
{ | |
/** | |
* Resolves an entry by its name. If given a class name, it will return a new instance of that class. | |
* | |
* @param string $name Entry name or a class name. | |
* @param array $parameters Optional parameters to use to build the entry. Use this to force specific | |
* parameters to specific values. Parameters not defined in this array will | |
* be automatically resolved. | |
* | |
* @throws \InvalidArgumentException The name parameter must be of type string. | |
* @throws DependencyException Error while resolving the entry. | |
* @throws NotFoundException No entry or class found for the given name. | |
*/ | |
public function make(string $name, array $parameters = []) : mixed; | |
} |