protected function determineHeaderTypeName(callable $callback)
	{
		if(is_array($callback))
		{
			$ref = new \ReflectionMethod(is_object($callback[0]) ? get_class($callback[0]) : $callback[0], $callback[1]);
		}
		elseif(is_object($callback) && !$callback instanceof \Closure)
		{
			$ref = new \ReflectionMethod(get_class($callback), '__invoke');
		}
		else
		{
			$ref = new \ReflectionFunction($callback);
		}
		
		$params = $ref->getParameters();
		
		if(empty($params))
		{
			throw new \InvalidArgumentException('Invalid header callback given, the callback must declare 1 argument');
		}
		
		$type = $params[0]->getClass();
		
		if(!$type instanceof \ReflectionClass)
		{
			throw new \InvalidArgumentException('Invalid header callback given, no type hint for first argument');
		}
		
		if(!$type->implementsInterface(HttpHeaderInterface::class))
		{
			throw new \InvalidArgumentException(sprintf('Invalid header callback given, %s is not an HTTP header implementation', $type->getName()));
		}
		
		return $type->getName();
	}
protected function determineHeaderTypeName(callable $callback)
	{
		if(is_array($callback))
		{
			$ref = new \ReflectionMethod(is_object($callback[0]) ? get_class($callback[0]) : $callback[0], $callback[1]);
		}
		elseif(is_object($callback) && !$callback instanceof \Closure)
		{
			$ref = new \ReflectionMethod(get_class($callback), '__invoke');
		}
		else
		{
			$ref = new \ReflectionFunction($callback);
		}
		
		$params = $ref->getParameters();
		
		if(empty($params))
		{
			throw new \InvalidArgumentException('Invalid header callback given, the callback must declare 1 argument');
		}
		
		$type = $params[0]->getClass();
		
		if(!$type instanceof \ReflectionClass)
		{
			throw new \InvalidArgumentException('Invalid header callback given, no type hint for first argument');
		}
		
		if(!$type->implementsInterface(HttpHeaderInterface::class))
		{
			throw new \InvalidArgumentException(sprintf('Invalid header callback given, %s is not an HTTP header implementation', $type->getName()));
		}
		
		return $type->getName();
	}
protected function determineHeaderTypeName ( callable $ callback ) { if ( is_array ( $ callback ) ) { $ ref = new \ ReflectionMethod ( is_object ( $ callback [ 0 ] ) ? get_class ( $ callback [ 0 ] ) : $ callback [ 0 ] , $ callback [ 1 ] ) ; } elseif ( is_object ( $ callback ) && ! $ callback instanceof \ Closure ) { $ ref = new \ ReflectionMethod ( get_class ( $ callback ) , '__invoke' ) ; } else { $ ref = new \ ReflectionFunction ( $ callback ) ; } $ params = $ ref -> getParameters ( ) ; if ( empty ( $ params ) ) { throw new \ InvalidArgumentException ( 'Invalid header callback given, the callback must declare 1 argument' ) ; } $ type = $ params [ 0 ] -> getClass ( ) ; if ( ! $ type instanceof \ ReflectionClass ) { throw new \ InvalidArgumentException ( 'Invalid header callback given, no type hint for first argument' ) ; } if ( ! $ type -> implementsInterface ( HttpHeaderInterface :: class ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Invalid header callback given, %s is not an HTTP header implementation' , $ type -> getName ( ) ) ) ; } return $ type -> getName ( ) ; }
Extract meta info of the first argument to the given callback and determine an HTTP header
implementation to be used.

@param callable $callback
@return string

@throws \InvalidArgumentException when the given callback does not specify a valid HTTP header argument.
Extract meta info of the first argument to the given callback and determine an HTTP header implementation to be used .