If there is an existing class instance for the given name, this method
checks if this class is part of the default namespace. If this is the
case this method will update all references to the new interface and it
removes the class instance. Otherwise it creates new interface instance.
Where possible you should give a qualified interface name, that is
prefixed with the package identifier.
$builder->buildInterface('php::depend::Parser');
To determine the correct interface, this method implements the following
algorithm.
- Check for an exactly matching instance and reuse it.
- Check for a interface instance that belongs to the default package.
If such an instance exists, reuse it and replace the default package
with the newly given package information.
- Check that the requested interface is in the default package, if
this is true, reuse the first interface instance and ignore the default
package.
- Create a new instance for the specified package.