. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ namespace Espo\Core\Binding\Key; /** * A key for a class-type-hinted constructor parameter with a qualifier. * Use it to bind to qualified constructor parameters. For example, one interface * can be used with a qualifier and without it. In the latter case, * the default binding it applied. While in the formed case, a special binding is applied. * For example, a caching pool interface may be bound to two different services: * core cache and application cache. * * @since 10.1.0 * * @template-covariant T of object */ class QualifiedClassKey { /** * @param class-string $className */ private function __construct(private string $className, private string $qualifier) {} /** * Create. * * @template TC of object * @param class-string $className An interface. * @param string $qualifier A qualification name. * @return self */ public static function create(string $className, string $qualifier): self { return new self($className, $qualifier); } public function toString(): string { return $this->className . ' #' . $this->qualifier; } }