$interface_or_class Interface or class to make an object instance out of. * @phpstan-param class-string[] $arguments Optional. Additional arguments to pass to the constructor. * Defaults to an empty array. * * @phpstan-return C * * @template C */ public function make( string $interface_or_class, array $arguments = [] ); /** * Bind a given interface or class to an implementation. * * Note: The implementation can be an interface as well, as long as it can * be resolved to an instantiatable class at runtime. * * @since 1.6.0 * * @param string $from Interface or class to bind an implementation to. * @param string $to Interface or class that provides the implementation. * * @phpstan-param class-string $from Interface or class to bind an implementation to. * @phpstan-param class-string $to Interface or class that provides the implementation. */ public function bind( string $from, string $to ): Injector; /** * Bind an argument for a class to a specific value. * * @since 1.6.0 * * @param string $interface_or_class Interface or class to bind an argument * for. * @param string $argument_name Argument name to bind a value to. * @param mixed $value Value to bind the argument to. * * @phpstan-param class-string $interface_or_class Interface or class to bind an argument */ public function bind_argument( string $interface_or_class, string $argument_name, $value ): Injector; /** * Always reuse and share the same instance for the provided interface or * class. * * @since 1.6.0 * * @param string $interface_or_class Interface or class to reuse. * * @phpstan-param class-string $interface_or_class Interface or class to reuse. */ public function share( string $interface_or_class ): Injector; /** * Delegate instantiation of an interface or class to a callable. * * @since 1.6.0 * * @param string $interface_or_class Interface or class to delegate the * instantiation of. * @param callable $callback Callable to use for instantiation. * * @phpstan-param class-string $interface_or_class Interface or class to delegate the * instantiation of. */ public function delegate( string $interface_or_class, callable $callback ): Injector; }