comparison vendor/zendframework/zend-diactoros/src/MessageTrait.php @ 12:7a779792577d

Update Drupal core to v8.4.5 (via Composer)
author Chris Cannam
date Fri, 23 Feb 2018 15:52:07 +0000
parents 4c8ae668cc8c
children c2387f117808
comparison
equal deleted inserted replaced
11:bfffd8d7479a 12:7a779792577d
1 <?php 1 <?php
2 /** 2 /**
3 * Zend Framework (http://framework.zend.com/) 3 * @see https://github.com/zendframework/zend-diactoros for the canonical source repository
4 * 4 * @copyright Copyright (c) 2015-2017 Zend Technologies USA Inc. (http://www.zend.com)
5 * @see http://github.com/zendframework/zend-diactoros for the canonical source repository
6 * @copyright Copyright (c) 2015-2016 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License 5 * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
8 */ 6 */
9 7
10 namespace Zend\Diactoros; 8 namespace Zend\Diactoros;
11 9
341 * @throws InvalidArgumentException on invalid HTTP protocol version 339 * @throws InvalidArgumentException on invalid HTTP protocol version
342 */ 340 */
343 private function validateProtocolVersion($version) 341 private function validateProtocolVersion($version)
344 { 342 {
345 if (empty($version)) { 343 if (empty($version)) {
346 throw new InvalidArgumentException(sprintf( 344 throw new InvalidArgumentException(
347 'HTTP protocol version can not be empty' 345 'HTTP protocol version can not be empty'
348 )); 346 );
349 } 347 }
350 if (! is_string($version)) { 348 if (! is_string($version)) {
351 throw new InvalidArgumentException(sprintf( 349 throw new InvalidArgumentException(sprintf(
352 'Unsupported HTTP protocol version; must be a string, received %s', 350 'Unsupported HTTP protocol version; must be a string, received %s',
353 (is_object($version) ? get_class($version) : gettype($version)) 351 (is_object($version) ? get_class($version) : gettype($version))