src/SitemapParser.php
protected function addArray($type, array $array)
    {
        if (!isset($array['loc'])) {
            return false;
        }
        $array['loc'] = $this->urlEncode(trim($array['loc']));
        if ($this->urlValidate($array['loc'])) {
            switch ($type) {
                case self::XML_TAG_SITEMAP:
                    $this->sitemaps[$array['loc']] = $this->fixMissingTags(['lastmod'], $array);
                    return true;
                case self::XML_TAG_URL:
                    $this->urls[$array['loc']] = $this->fixMissingTags(['lastmod', 'changefreq', 'priority'], $array);
                    return true;
            }
        }
        return false;
    }
protected function addArray($type, array $array)
    {
        if (!isset($array['loc'])) {
            return false;
        }
        $array['loc'] = $this->urlEncode(trim($array['loc']));
        if ($this->urlValidate($array['loc'])) {
            switch ($type) {
                case self::XML_TAG_SITEMAP:
                    $this->sitemaps[$array['loc']] = $this->fixMissingTags(['lastmod'], $array);
                    return true;
                case self::XML_TAG_URL:
                    $this->urls[$array['loc']] = $this->fixMissingTags(['lastmod', 'changefreq', 'priority'], $array);
                    return true;
            }
        }
        return false;
    }
protected function addArray ( $ type , array $ array ) { if ( ! isset ( $ array [ 'loc' ] ) ) { return false ; } $ array [ 'loc' ] = $ this -> urlEncode ( trim ( $ array [ 'loc' ] ) ) ; if ( $ this -> urlValidate ( $ array [ 'loc' ] ) ) { switch ( $ type ) { case self :: XML_TAG_SITEMAP : $ this -> sitemaps [ $ array [ 'loc' ] ] = $ this -> fixMissingTags ( [ 'lastmod' ] , $ array ) ; return true ; case self :: XML_TAG_URL : $ this -> urls [ $ array [ 'loc' ] ] = $ this -> fixMissingTags ( [ 'lastmod' , 'changefreq' , 'priority' ] , $ array ) ; return true ; } } return false ; }
Validate URL arrays and add them to their corresponding arrays

@param string $type sitemap|url
@param array $array Tag array
@return bool
Validate URL arrays and add them to their corresponding arrays