public function addItem($url, $lastMod = null):void
    {
        if ($this->has($this->file)) {
            $this->appendItem($url, $lastMod);
        } else {
            $this->create('create', $url, $lastMod);
        }
    }
public function addItem($url, $lastMod = null):void
    {
        if ($this->has($this->file)) {
            $this->appendItem($url, $lastMod);
        } else {
            $this->create('create', $url, $lastMod);
        }
    }
public function addItem ( $ url , $ lastMod = null ) : void { if ( $ this -> has ( $ this -> file ) ) { $ this -> appendItem ( $ url , $ lastMod ) ; } else { $ this -> create ( 'create' , $ url , $ lastMod ) ; } }
Add item to sitemap.

@param (string) $url     Valid url.
@param (string) $lastMod Last modify.

@since 3.0.0

@return void
Add item to sitemap .