Skip to content

Commit a324ced

Browse files
committed
Update usage of Str and Arr classes
1 parent 918cdfb commit a324ced

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/CacheKey.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ protected function getLimitClause() : string
6464

6565
protected function getTableSlug() : string
6666
{
67-
return Str::slug($this->model->getTable())
67+
return (new Str)->slug($this->model->getTable())
6868
. ":";
6969
}
7070

7171
protected function getModelSlug() : string
7272
{
73-
return Str::slug(get_class($this->model));
73+
return (new Str)->slug(get_class($this->model));
7474
}
7575

7676
protected function getOffsetClause() : string
@@ -89,7 +89,7 @@ protected function getOrderByClauses() : string
8989
return $orders
9090
->reduce(function ($carry, $order) {
9191
if (($order["type"] ?? "") === "Raw") {
92-
return $carry . "_orderByRaw_" . Str::slug($order["sql"]);
92+
return $carry . "_orderByRaw_" . (new Str)->slug($order["sql"]);
9393
}
9494

9595
return $carry . "_orderBy_" . $order["column"] . "_" . $order["direction"];
@@ -129,7 +129,7 @@ protected function getValuesClause(array $where = null) : string
129129

130130
protected function getValuesFromWhere(array $where) : string
131131
{
132-
if (Arr::get($where, "query")) {
132+
if ((new Arr)->get($where, "query")) {
133133
$prefix = $this->getCachePrefix();
134134
$subKey = (new self($this->eagerLoad, $this->model, $where["query"]))
135135
->make();
@@ -141,16 +141,15 @@ protected function getValuesFromWhere(array $where) : string
141141
return $subKey;
142142
}
143143

144-
if (is_array(Arr::get($where, "values"))) {
144+
if (is_array((new Arr)->get($where, "values"))) {
145145
return implode("_", collect($where["values"])->flatten()->toArray());
146146
}
147147

148-
return Arr::get($where, "value", "");
148+
return (new Arr)->get($where, "value", "");
149149
}
150150

151151
protected function getValuesFromBindings(array $where, string $values) : string
152152
{
153-
// if (! $values && ($this->query->bindings["where"][$this->currentBinding] ?? false)) {
154153
if ($this->query->bindings["where"][$this->currentBinding] ?? false) {
155154
$values = $this->query->bindings["where"][$this->currentBinding];
156155
$this->currentBinding++;

src/CacheTags.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function make() : array
3333
$relation = $this->getRelation($relationName);
3434

3535
return $this->getCachePrefix()
36-
. Str::slug(get_class($relation->getQuery()->getModel()));
36+
. (new Str)->slug(get_class($relation->getQuery()->getModel()));
3737
})
3838
->prepend($this->getTagName())
3939
->values()
@@ -65,6 +65,6 @@ protected function getRelation(string $relationName) : Relation
6565
protected function getTagName() : string
6666
{
6767
return $this->getCachePrefix()
68-
. Str::slug(get_class($this->model));
68+
. (new Str)->slug(get_class($this->model));
6969
}
7070
}

0 commit comments

Comments
 (0)