comparison vendor/zendframework/zend-stdlib/src/StringWrapper/Native.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 5fb285c0d0e3
comparison
equal deleted inserted replaced
11:bfffd8d7479a 12:7a779792577d
33 public static function isSupported($encoding, $convertEncoding = null) 33 public static function isSupported($encoding, $convertEncoding = null)
34 { 34 {
35 $encodingUpper = strtoupper($encoding); 35 $encodingUpper = strtoupper($encoding);
36 $supportedEncodings = static::getSupportedEncodings(); 36 $supportedEncodings = static::getSupportedEncodings();
37 37
38 if (!in_array($encodingUpper, $supportedEncodings)) { 38 if (! in_array($encodingUpper, $supportedEncodings)) {
39 return false; 39 return false;
40 } 40 }
41 41
42 // This adapter doesn't support to convert between encodings 42 // This adapter doesn't support to convert between encodings
43 if ($convertEncoding !== null && $encodingUpper !== strtoupper($convertEncoding)) { 43 if ($convertEncoding !== null && $encodingUpper !== strtoupper($convertEncoding)) {
67 public function setEncoding($encoding, $convertEncoding = null) 67 public function setEncoding($encoding, $convertEncoding = null)
68 { 68 {
69 $supportedEncodings = static::getSupportedEncodings(); 69 $supportedEncodings = static::getSupportedEncodings();
70 70
71 $encodingUpper = strtoupper($encoding); 71 $encodingUpper = strtoupper($encoding);
72 if (!in_array($encodingUpper, $supportedEncodings)) { 72 if (! in_array($encodingUpper, $supportedEncodings)) {
73 throw new Exception\InvalidArgumentException( 73 throw new Exception\InvalidArgumentException(
74 'Wrapper doesn\'t support character encoding "' . $encoding . '"' 74 'Wrapper doesn\'t support character encoding "' . $encoding . '"'
75 ); 75 );
76 } 76 }
77 77