protected function reflectionFactory(string $class, array $parameters): object
	{
		$class = new ReflectionClass($class);

		// Check that it's possible to instantiate the class

		if(!$class->isInstantiable())
		{
			throw new UnableToInstantiateException(vsprintf('Unable to create a [ %s ] instance.', [$class->getName()]));
		}

		// Get the class constructor

		$constructor = $class->getConstructor();

		// If we don't have a constructor then we'll just return a new instance

		if($constructor === null)
		{
			return $class->newInstance();
		}

		// The class had a constructor so we'll return a new instance using our resolved parameters

		return $class->newInstanceArgs($this->resolveParameters($constructor->getParameters(), $parameters, $class));
	}