X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=vendor%2Fsymfony%2Fconfig%2FUtil%2FXmlUtils.php;h=8ad58d61e6ab4312592600aca2bf11cc25250a30;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=e1c4a4ad3f01e97a3a51a2a3c1b2898687e23945;hpb=af6d1fb995500ae68849458ee10d66abbdcfb252;p=yaffs-website diff --git a/vendor/symfony/config/Util/XmlUtils.php b/vendor/symfony/config/Util/XmlUtils.php index e1c4a4ad3..8ad58d61e 100644 --- a/vendor/symfony/config/Util/XmlUtils.php +++ b/vendor/symfony/config/Util/XmlUtils.php @@ -46,7 +46,7 @@ class XmlUtils */ public static function parse($content, $schemaOrCallable = null) { - if (!extension_loaded('dom')) { + if (!\extension_loaded('dom')) { throw new \RuntimeException('Extension DOM is required.'); } @@ -56,7 +56,7 @@ class XmlUtils $dom = new \DOMDocument(); $dom->validateOnParse = true; - if (!$dom->loadXML($content, LIBXML_NONET | (defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0))) { + if (!$dom->loadXML($content, LIBXML_NONET | (\defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0))) { libxml_disable_entity_loader($disableEntities); throw new XmlParsingException(implode("\n", static::getXmlErrors($internalErrors))); @@ -78,13 +78,13 @@ class XmlUtils libxml_clear_errors(); $e = null; - if (is_callable($schemaOrCallable)) { + if (\is_callable($schemaOrCallable)) { try { - $valid = call_user_func($schemaOrCallable, $dom, $internalErrors); + $valid = \call_user_func($schemaOrCallable, $dom, $internalErrors); } catch (\Exception $e) { $valid = false; } - } elseif (!is_array($schemaOrCallable) && is_file((string) $schemaOrCallable)) { + } elseif (!\is_array($schemaOrCallable) && is_file((string) $schemaOrCallable)) { $schemaSource = file_get_contents((string) $schemaOrCallable); $valid = @$dom->schemaValidateSource($schemaSource); } else { @@ -160,7 +160,7 @@ class XmlUtils $empty = true; $config = array(); foreach ($element->attributes as $name => $node) { - if ($checkPrefix && !in_array((string) $node->prefix, array('', $prefix), true)) { + if ($checkPrefix && !\in_array((string) $node->prefix, array('', $prefix), true)) { continue; } $config[$name] = static::phpize($node->value); @@ -181,7 +181,7 @@ class XmlUtils $key = $node->localName; if (isset($config[$key])) { - if (!is_array($config[$key]) || !is_int(key($config[$key]))) { + if (!\is_array($config[$key]) || !\is_int(key($config[$key]))) { $config[$key] = array($config[$key]); } $config[$key][] = $value; @@ -195,7 +195,7 @@ class XmlUtils if (false !== $nodeValue) { $value = static::phpize($nodeValue); - if (count($config)) { + if (\count($config)) { $config['value'] = $value; } else { $config = $value; @@ -240,7 +240,7 @@ class XmlUtils return '0x' === $value[0].$value[1] ? hexdec($value) : (float) $value; case preg_match('/^0x[0-9a-f]++$/i', $value): return hexdec($value); - case preg_match('/^(-|\+)?[0-9]+(\.[0-9]+)?$/', $value): + case preg_match('/^[+-]?[0-9]+(\.[0-9]+)?$/', $value): return (float) $value; default: return $value;