Swader / diffbot-php-client

[Deprecated - Maintenance mode - use APIs directly please!] The official Diffbot client library
MIT License
53 stars 20 forks source link

[Critical] Setting custom entity factories doesn't work #30

Closed Swader closed 8 years ago

Swader commented 8 years ago

Due to a lapse in logic, the setCustomEntity method on the Diffbot class is always called without an argument if the setHttpClient isn't called beforehand.

Change

        if (!$this->getHttpClient()) {
            $this->setHttpClient();
            $this->setEntityFactory();
        }

to

        if (!$this->getHttpClient()) {
            $this->setHttpClient();
        }
        if (!$this->getEntityFactory()) {
            $this->setEntityFactory();
        }

everywhere for a fix.