comparison vendor/symfony/polyfill-php70/Php70.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents c2387f117808
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
51 51
52 public static function error_clear_last() 52 public static function error_clear_last()
53 { 53 {
54 static $handler; 54 static $handler;
55 if (!$handler) { 55 if (!$handler) {
56 $handler = function() { return false; }; 56 $handler = function () { return false; };
57 } 57 }
58 set_error_handler($handler); 58 set_error_handler($handler);
59 @trigger_error(''); 59 @trigger_error('');
60 restore_error_handler(); 60 restore_error_handler();
61 } 61 }
64 { 64 {
65 if (\is_int($value)) { 65 if (\is_int($value)) {
66 return $value; 66 return $value;
67 } 67 }
68 if (!\is_numeric($value) || PHP_INT_MAX <= ($value += 0) || ~PHP_INT_MAX >= $value) { 68 if (!\is_numeric($value) || PHP_INT_MAX <= ($value += 0) || ~PHP_INT_MAX >= $value) {
69 throw new \TypeError(sprintf('%s() expects parameter %d to be integer, %s given', $caller, $pos, gettype($value))); 69 throw new \TypeError(sprintf('%s() expects parameter %d to be integer, %s given', $caller, $pos, \gettype($value)));
70 } 70 }
71 71
72 return (int) $value; 72 return (int) $value;
73 } 73 }
74 } 74 }