* @see https://refactoring.guru/design-patterns/strategy
*
* @param string $interface The interface, which the given class implements
- * @param string $name The name of the given class, which will be used for factories, dependency injections etc.
- * @param string $class The class of the given class
+ * @param string $name An arbitrary identifier for the given class, which will be used for factories, dependency injections etc.
+ * @param string $class The fully-qualified given class name
* @param ?array $arguments Additional arguments, which can be passed to the constructor
*
* @return $this This interface for chain-calls
*
* @note Decorator attach new behaviors to classes without changing them or without letting them know about it.
*
- * @param string $class The class or interface, which gets decorated by a class
- * @param string $decoratorClass The class, which mimics the given class or interface and adds new functionality
+ * @param string $class The fully-qualified class or interface name, which gets decorated by a class
+ * @param string $decoratorClass The fully-qualified name of the class which mimics the given class or interface and adds new functionality
* @param array $arguments Additional arguments, which can be passed to the constructor of "decoratorClass"
*
* @return $this This interface for chain-calls
* In case, there are registered decorators for this class as well, all decorators of the list will be wrapped
* around the instance before returning it
*
- * @param string $class A given class or interface, which will get returned
+ * @param string $class The fully-qualified name of the given class or interface which will get returned
* @param string $name The name of the concrete class, wich
* @param array $arguments Additional arguments, which can be passed to the constructor of "$class" at runtime
*
public function registerDecorator(string $class, string $decoratorClass, array $arguments = []): ICanManageInstances
{
if (!is_a($decoratorClass, $class, true)) {
- throw new HookRegisterArgumentException(sprintf('%s is not a valid subsituation for the given class or interface %s', $decoratorClass, $class));
+ throw new HookRegisterArgumentException(sprintf('%s is not a valid substitution for the given class or interface %s', $decoratorClass, $class));
}
$this->decorator[$class][] = [