artesaos/seotools

JsonLd isEmpty method does not check for empty Url

rajakhoury opened this issue · 0 comments

I think this is a typo but the method has an undefined variable $url

public function isEmpty()
{
    return empty($this->values)
        && empty($this->type)
        && empty($this->title)
        && empty($this->description)
        && empty($url) // should be $this->url
        && empty($this->images);
}

also the test pass when it shouldn't:

public function test_is_empty()
{
    // make default json-ld data as empty on create
    config()->set('seotools.json-ld.defaults',[]);
    $this->jsonLd = new JsonLd();
    $this->jsonLd->setUrl('http://domain.com');

    $this->assertTrue($this->jsonLd->isEmpty());
}