/** * @see Loadable::load * @param string $source * @param string $contentType * @param array|\Traversable|Options $options * @return Document|Result|NULL */ public function load($source, $contentType, $options = []) { if ($this->supports($contentType)) { $dom = new Document(); $dom->preserveWhiteSpace = FALSE; $loadOptions = isset($options[self::LIBXML_OPTIONS]) ? (int) $options[self::LIBXML_OPTIONS] : 0; if ($this->startsWith($source, '<')) { $dom->loadXml($source, $loadOptions); } else { $dom->load($source, $loadOptions); } return $dom; } return NULL; }