Skip to content

Commit 7ac9547

Browse files
committed
style(aliases): rename aliases array to typesenseAliases
* rename array variable to avoid reserving the `aliases` name for aliases * the get magic method checks if the name passed is set, and returns that * if the name matches the term `aliases`, the array would be returned instead
1 parent 94570c3 commit 7ac9547

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/Aliases.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Aliases implements \ArrayAccess
2424
/**
2525
* @var array
2626
*/
27-
private array $aliases = [];
27+
private array $typesenseAliases = [];
2828

2929
/**
3030
* Aliases constructor.
@@ -78,46 +78,46 @@ public function __get($name)
7878
return $this->{$name};
7979
}
8080

81-
if (!isset($this->aliases[$name])) {
82-
$this->aliases[$name] = new Alias($name, $this->apiCall);
81+
if (!isset($this->typesenseAliases[$name])) {
82+
$this->typesenseAliases[$name] = new Alias($name, $this->apiCall);
8383
}
8484

85-
return $this->aliases[$name];
85+
return $this->typesenseAliases[$name];
8686
}
8787

8888
/**
8989
* @inheritDoc
9090
*/
9191
public function offsetExists($offset): bool
9292
{
93-
return isset($this->aliases[$offset]);
93+
return isset($this->typesenseAliases[$offset]);
9494
}
9595

9696
/**
9797
* @inheritDoc
9898
*/
9999
public function offsetGet($offset): Alias
100100
{
101-
if (!isset($this->aliases[$offset])) {
102-
$this->aliases[$offset] = new Alias($offset, $this->apiCall);
101+
if (!isset($this->typesenseAliases[$offset])) {
102+
$this->typesenseAliases[$offset] = new Alias($offset, $this->apiCall);
103103
}
104104

105-
return $this->aliases[$offset];
105+
return $this->typesenseAliases[$offset];
106106
}
107107

108108
/**
109109
* @inheritDoc
110110
*/
111111
public function offsetSet($offset, $value): void
112112
{
113-
$this->aliases[$offset] = $value;
113+
$this->typesenseAliases[$offset] = $value;
114114
}
115115

116116
/**
117117
* @inheritDoc
118118
*/
119119
public function offsetUnset($offset): void
120120
{
121-
unset($this->aliases[$offset]);
121+
unset($this->typesenseAliases[$offset]);
122122
}
123123
}

0 commit comments

Comments
 (0)