Skip to content

Commit f6a6734

Browse files
committed
Fixes #30
1 parent af85a09 commit f6a6734

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/Diffbot.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ public function createProductAPI($url)
145145
$api = new Product($url);
146146
if (!$this->getHttpClient()) {
147147
$this->setHttpClient();
148+
}
149+
if (!$this->getEntityFactory()) {
148150
$this->setEntityFactory();
149151
}
150152
return $api->registerDiffbot($this);
@@ -161,6 +163,8 @@ public function createArticleAPI($url)
161163
$api = new Article($url);
162164
if (!$this->getHttpClient()) {
163165
$this->setHttpClient();
166+
}
167+
if (!$this->getEntityFactory()) {
164168
$this->setEntityFactory();
165169
}
166170
return $api->registerDiffbot($this);
@@ -177,6 +181,8 @@ public function createImageAPI($url)
177181
$api = new Image($url);
178182
if (!$this->getHttpClient()) {
179183
$this->setHttpClient();
184+
}
185+
if (!$this->getEntityFactory()) {
180186
$this->setEntityFactory();
181187
}
182188
return $api->registerDiffbot($this);
@@ -193,6 +199,8 @@ public function createAnalyzeAPI($url)
193199
$api = new Analyze($url);
194200
if (!$this->getHttpClient()) {
195201
$this->setHttpClient();
202+
}
203+
if (!$this->getEntityFactory()) {
196204
$this->setEntityFactory();
197205
}
198206
return $api->registerDiffbot($this);
@@ -209,6 +217,8 @@ public function createDiscussionAPI($url)
209217
$api = new Discussion($url);
210218
if (!$this->getHttpClient()) {
211219
$this->setHttpClient();
220+
}
221+
if (!$this->getEntityFactory()) {
212222
$this->setEntityFactory();
213223
}
214224
return $api->registerDiffbot($this);
@@ -228,6 +238,8 @@ public function createCustomAPI($url, $name)
228238
$api = new Custom($url, $name);
229239
if (!$this->getHttpClient()) {
230240
$this->setHttpClient();
241+
}
242+
if (!$this->getEntityFactory()) {
231243
$this->setEntityFactory();
232244
}
233245
return $api->registerDiffbot($this);
@@ -248,6 +260,8 @@ public function crawl($name = null, Api $api = null)
248260
$api = new Crawl($name, $api);
249261
if (!$this->getHttpClient()) {
250262
$this->setHttpClient();
263+
}
264+
if (!$this->getEntityFactory()) {
251265
$this->setEntityFactory();
252266
}
253267
return $api->registerDiffbot($this);
@@ -264,6 +278,8 @@ public function search($q)
264278
$api = new Search($q);
265279
if (!$this->getHttpClient()) {
266280
$this->setHttpClient();
281+
}
282+
if (!$this->getEntityFactory()) {
267283
$this->setEntityFactory();
268284
}
269285
return $api->registerDiffbot($this);

0 commit comments

Comments
 (0)