comparison vendor/zendframework/zend-stdlib/src/Message.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
38 { 38 {
39 if (is_scalar($spec)) { 39 if (is_scalar($spec)) {
40 $this->metadata[$spec] = $value; 40 $this->metadata[$spec] = $value;
41 return $this; 41 return $this;
42 } 42 }
43 if (!is_array($spec) && !$spec instanceof Traversable) { 43 if (! is_array($spec) && ! $spec instanceof Traversable) {
44 throw new Exception\InvalidArgumentException(sprintf( 44 throw new Exception\InvalidArgumentException(sprintf(
45 'Expected a string, array, or Traversable argument in first position; received "%s"', 45 'Expected a string, array, or Traversable argument in first position; received "%s"',
46 (is_object($spec) ? get_class($spec) : gettype($spec)) 46 (is_object($spec) ? get_class($spec) : gettype($spec))
47 )); 47 ));
48 } 48 }
64 { 64 {
65 if (null === $key) { 65 if (null === $key) {
66 return $this->metadata; 66 return $this->metadata;
67 } 67 }
68 68
69 if (!is_scalar($key)) { 69 if (! is_scalar($key)) {
70 throw new Exception\InvalidArgumentException('Non-scalar argument provided for key'); 70 throw new Exception\InvalidArgumentException('Non-scalar argument provided for key');
71 } 71 }
72 72
73 if (array_key_exists($key, $this->metadata)) { 73 if (array_key_exists($key, $this->metadata)) {
74 return $this->metadata[$key]; 74 return $this->metadata[$key];