diff --git a/src/Aliases.php b/src/Aliases.php index 157fbc49..b4eac737 100644 --- a/src/Aliases.php +++ b/src/Aliases.php @@ -24,7 +24,7 @@ class Aliases implements \ArrayAccess /** * @var array */ - private array $aliases = []; + private array $typesenseAliases = []; /** * Aliases constructor. @@ -78,11 +78,11 @@ public function __get($name) return $this->{$name}; } - if (!isset($this->aliases[$name])) { - $this->aliases[$name] = new Alias($name, $this->apiCall); + if (!isset($this->typesenseAliases[$name])) { + $this->typesenseAliases[$name] = new Alias($name, $this->apiCall); } - return $this->aliases[$name]; + return $this->typesenseAliases[$name]; } /** @@ -90,7 +90,7 @@ public function __get($name) */ public function offsetExists($offset): bool { - return isset($this->aliases[$offset]); + return isset($this->typesenseAliases[$offset]); } /** @@ -98,11 +98,11 @@ public function offsetExists($offset): bool */ public function offsetGet($offset): Alias { - if (!isset($this->aliases[$offset])) { - $this->aliases[$offset] = new Alias($offset, $this->apiCall); + if (!isset($this->typesenseAliases[$offset])) { + $this->typesenseAliases[$offset] = new Alias($offset, $this->apiCall); } - return $this->aliases[$offset]; + return $this->typesenseAliases[$offset]; } /** @@ -110,7 +110,7 @@ public function offsetGet($offset): Alias */ public function offsetSet($offset, $value): void { - $this->aliases[$offset] = $value; + $this->typesenseAliases[$offset] = $value; } /** @@ -118,6 +118,6 @@ public function offsetSet($offset, $value): void */ public function offsetUnset($offset): void { - unset($this->aliases[$offset]); + unset($this->typesenseAliases[$offset]); } } diff --git a/src/Collections.php b/src/Collections.php index b2a769ae..6a3942c8 100644 --- a/src/Collections.php +++ b/src/Collections.php @@ -24,7 +24,7 @@ class Collections implements \ArrayAccess /** * @var array */ - private array $collections = []; + private array $typesenseCollections = []; /** * Collections constructor. @@ -46,11 +46,11 @@ public function __get($collectionName) if (isset($this->{$collectionName})) { return $this->{$collectionName}; } - if (!isset($this->collections[$collectionName])) { - $this->collections[$collectionName] = new Collection($collectionName, $this->apiCall); + if (!isset($this->typesenseCollections[$collectionName])) { + $this->typesenseCollections[$collectionName] = new Collection($collectionName, $this->apiCall); } - return $this->collections[$collectionName]; + return $this->typesenseCollections[$collectionName]; } /** @@ -79,7 +79,7 @@ public function retrieve(): array */ public function offsetExists($offset): bool { - return isset($this->collections[$offset]); + return isset($this->typesenseCollections[$offset]); } /** @@ -87,11 +87,11 @@ public function offsetExists($offset): bool */ public function offsetGet($offset): Collection { - if (!isset($this->collections[$offset])) { - $this->collections[$offset] = new Collection($offset, $this->apiCall); + if (!isset($this->typesenseCollections[$offset])) { + $this->typesenseCollections[$offset] = new Collection($offset, $this->apiCall); } - return $this->collections[$offset]; + return $this->typesenseCollections[$offset]; } /** @@ -99,7 +99,7 @@ public function offsetGet($offset): Collection */ public function offsetSet($offset, $value): void { - $this->collections[$offset] = $value; + $this->typesenseCollections[$offset] = $value; } /** @@ -107,6 +107,6 @@ public function offsetSet($offset, $value): void */ public function offsetUnset($offset): void { - unset($this->collections[$offset]); + unset($this->typesenseCollections[$offset]); } } diff --git a/src/ConversationModels.php b/src/ConversationModels.php index a75ef260..19890245 100644 --- a/src/ConversationModels.php +++ b/src/ConversationModels.php @@ -22,7 +22,7 @@ class ConversationModels implements \ArrayAccess /** * @var array */ - private array $models = []; + private array $typesenseModels = []; /** * ConversationModels constructor. @@ -44,11 +44,11 @@ public function __get($id) if (isset($this->{$id})) { return $this->{$id}; } - if (!isset($this->models[$id])) { - $this->models[$id] = new ConversationModel($id, $this->apiCall); + if (!isset($this->typesenseModels[$id])) { + $this->typesenseModels[$id] = new ConversationModel($id, $this->apiCall); } - return $this->models[$id]; + return $this->typesenseModels[$id]; } /** @@ -76,7 +76,7 @@ public function retrieve(): array */ public function offsetExists($offset): bool { - return isset($this->models[$offset]); + return isset($this->typesenseModels[$offset]); } /** @@ -84,11 +84,11 @@ public function offsetExists($offset): bool */ public function offsetGet($offset): ConversationModel { - if (!isset($this->models[$offset])) { - $this->models[$offset] = new ConversationModel($offset, $this->apiCall); + if (!isset($this->typesenseModels[$offset])) { + $this->typesenseModels[$offset] = new ConversationModel($offset, $this->apiCall); } - return $this->models[$offset]; + return $this->typesenseModels[$offset]; } /** @@ -96,7 +96,7 @@ public function offsetGet($offset): ConversationModel */ public function offsetSet($offset, $value): void { - $this->models[$offset] = $value; + $this->typesenseModels[$offset] = $value; } /** @@ -104,6 +104,6 @@ public function offsetSet($offset, $value): void */ public function offsetUnset($offset): void { - unset($this->models[$offset]); + unset($this->typesenseModels[$offset]); } } diff --git a/src/Conversations.php b/src/Conversations.php index dd4698f1..3ec1d309 100644 --- a/src/Conversations.php +++ b/src/Conversations.php @@ -14,7 +14,7 @@ class Conversations implements \ArrayAccess /** * @var ConversationModels */ - public ConversationModels $models; + public ConversationModels $typesenseModels; /** * @var ApiCall @@ -34,7 +34,7 @@ class Conversations implements \ArrayAccess public function __construct(ApiCall $apiCall) { $this->apiCall = $apiCall; - $this->models = new ConversationModels($this->apiCall); + $this->typesenseModels = new ConversationModels($this->apiCall); } /** @@ -51,7 +51,7 @@ public function retrieve(): array */ public function getModels(): ConversationModels { - return $this->models; + return $this->typesenseModels; } /** diff --git a/src/Presets.php b/src/Presets.php index 84922af5..d18044cf 100644 --- a/src/Presets.php +++ b/src/Presets.php @@ -26,7 +26,7 @@ class Presets implements \ArrayAccess /** * @var array */ - private array $presets = []; + private array $typesensePresets = []; /** * Presets constructor. @@ -107,11 +107,11 @@ public function __get($presetName) if (isset($this->{$presetName})) { return $this->{$presetName}; } - if (!isset($this->presets[$presetName])) { - $this->presets[$presetName] = new Preset($presetName, $this->apiCall); + if (!isset($this->typesensePresets[$presetName])) { + $this->typesensePresets[$presetName] = new Preset($presetName, $this->apiCall); } - return $this->presets[$presetName]; + return $this->typesensePresets[$presetName]; } /** @@ -119,7 +119,7 @@ public function __get($presetName) */ public function offsetExists($offset): bool { - return isset($this->presets[$offset]); + return isset($this->typesensePresets[$offset]); } /** @@ -127,11 +127,11 @@ public function offsetExists($offset): bool */ public function offsetGet($offset): Preset { - if (!isset($this->presets[$offset])) { - $this->presets[$offset] = new Preset($offset, $this->apiCall); + if (!isset($this->typesensePresets[$offset])) { + $this->typesensePresets[$offset] = new Preset($offset, $this->apiCall); } - return $this->presets[$offset]; + return $this->typesensePresets[$offset]; } /** @@ -139,7 +139,7 @@ public function offsetGet($offset): Preset */ public function offsetSet($offset, $value): void { - $this->presets[$offset] = $value; + $this->typesensePresets[$offset] = $value; } /** @@ -147,6 +147,6 @@ public function offsetSet($offset, $value): void */ public function offsetUnset($offset): void { - unset($this->presets[$offset]); + unset($this->typesensePresets[$offset]); } } diff --git a/tests/Feature/ConversationModelTest.php b/tests/Feature/ConversationModelTest.php index 675eb0e5..aa9903e2 100644 --- a/tests/Feature/ConversationModelTest.php +++ b/tests/Feature/ConversationModelTest.php @@ -13,7 +13,7 @@ public function testCanGetAModelById(): void { $this->mockApiCall()->allows()->get($this->endPointPath(), [])->andReturns([]); - $response = $this->mockConversations()->models[$this->id]->retrieve(); + $response = $this->mockConversations()->typesenseModels[$this->id]->retrieve(); $this->assertEquals([], $response); } @@ -24,7 +24,7 @@ public function testCanUpdateAModelById(): void ]; $this->mockApiCall()->allows()->put($this->endPointPath(), $data)->andReturns([]); - $response = $this->mockConversations()->models[$this->id]->update($data); + $response = $this->mockConversations()->typesenseModels[$this->id]->update($data); $this->assertEquals([], $response); } @@ -32,7 +32,7 @@ public function testCanDeleteAModelById(): void { $this->mockApiCall()->allows()->delete($this->endPointPath())->andReturns([]); - $response = $this->mockConversations()->models[$this->id]->delete(); + $response = $this->mockConversations()->typesenseModels[$this->id]->delete(); $this->assertEquals([], $response); } diff --git a/tests/Feature/ConversationModelsTest.php b/tests/Feature/ConversationModelsTest.php index 70603285..1767f20e 100644 --- a/tests/Feature/ConversationModelsTest.php +++ b/tests/Feature/ConversationModelsTest.php @@ -19,16 +19,16 @@ public function testCanCreateAModel(): void $this->mockApiCall()->allows()->post(static::RESOURCE_PATH, $data)->andReturns([]); - $response = $this->mockConversations()->models->create($data); + $response = $this->mockConversations()->typesenseModels->create($data); $this->assertEquals([], $response); } public function testCanRetrieveAllModels(): void { $this->mockApiCall()->allows()->get(static::RESOURCE_PATH, [])->andReturns([]); - $this->mockConversations()->models->retrieve(); + $this->mockConversations()->typesenseModels->retrieve(); - $response = $this->client()->conversations->models->retrieve(); + $response = $this->client()->conversations->typesenseModels->retrieve(); $this->assertEquals([], $response); } }