comparison vendor/zendframework/zend-diactoros/src/MessageTrait.php @ 4:a9cd425dd02b

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:11:55 +0000
parents 5311817fb629
children
comparison
equal deleted inserted replaced
3:307d7a7fd348 4:a9cd425dd02b
383 { 383 {
384 if (! is_array($values)) { 384 if (! is_array($values)) {
385 $values = [$values]; 385 $values = [$values];
386 } 386 }
387 387
388 if ([] === $values) {
389 throw new InvalidArgumentException(
390 'Invalid header value: must be a string or array of strings; '
391 . 'cannot be an empty array'
392 );
393 }
394
388 return array_map(function ($value) { 395 return array_map(function ($value) {
389 HeaderSecurity::assertValid($value); 396 HeaderSecurity::assertValid($value);
390 397
391 return (string) $value; 398 return (string) $value;
392 }, $values); 399 }, array_values($values));
393 } 400 }
394 401
395 /** 402 /**
396 * Ensure header name and values are valid. 403 * Ensure header name and values are valid.
397 * 404 *