public static function registerResponseClass(
		string $responseClassName,
		string...$accept
	):void {
		if(empty($accept)) {
			$accept = [self::DEFAULT_ACCEPT];
		}

		foreach($accept as $a) {
			static::$responseClassLookup [$a] = $responseClassName;
		}
	}
public static function registerResponseClass(
		string $responseClassName,
		string...$accept
	):void {
		if(empty($accept)) {
			$accept = [self::DEFAULT_ACCEPT];
		}

		foreach($accept as $a) {
			static::$responseClassLookup [$a] = $responseClassName;
		}
	}
public static function registerResponseClass ( string $ responseClassName , string ... $ accept ) : void { if ( empty ( $ accept ) ) { $ accept = [ self :: DEFAULT_ACCEPT ] ; } foreach ( $ accept as $ a ) { static :: $ responseClassLookup [ $ a ] = $ responseClassName ; } }
In order for this factory to create the correct type of Response, class names need
to be registered to match the request's "accept" header. This allows the web client to
request a web page in HTML format, over a web API in JSON format, for example.
In order for this factory to create the correct type of Response class names need to be registered to match the request s accept header . This allows the web client to request a web page in HTML format over a web API in JSON format for example .