Skip to content

Commit feb93a9

Browse files
authored
Merge pull request #166 from ce-brex/master
Replaced deprecated helpers with corresponding Str:: and Arr:: functions
2 parents 9613532 + 62ff023 commit feb93a9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Filters/FiltersExact.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function withRelationConstraint(Builder $query, $value, string $proper
4545
[$relation, $property] = collect(explode('.', $property))
4646
->pipe(function (Collection $parts) {
4747
return [
48-
$parts->except(count($parts) - 1)->map('camel_case')->implode('.'),
48+
$parts->except(count($parts) - 1)->map([Str::class, 'camel'])->implode('.'),
4949
$parts->last(),
5050
];
5151
});

src/QueryBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,14 +361,14 @@ protected function addAppendsToResults(Collection $results)
361361
protected function addIncludesToQuery(Collection $includes)
362362
{
363363
$includes
364-
->map('camel_case')
364+
->map([Str::class, 'camel'])
365365
->map(function (string $include) {
366366
return collect(explode('.', $include));
367367
})
368368
->flatMap(function (Collection $relatedTables) {
369369
return $relatedTables
370370
->mapWithKeys(function ($table, $key) use ($relatedTables) {
371-
$fields = $this->getFieldsForIncludedTable(snake_case($table));
371+
$fields = $this->getFieldsForIncludedTable(Str::snake($table));
372372

373373
$fullRelationName = $relatedTables->slice(0, $key + 1)->implode('.');
374374

@@ -405,7 +405,7 @@ protected function guardAgainstUnknownFields()
405405
->map(function ($fields, $model) {
406406
$tableName = Str::snake(preg_replace('/-/', '_', $model));
407407

408-
$fields = array_map('snake_case', $fields);
408+
$fields = array_map([Str::class, 'snake'], $fields);
409409

410410
return $this->prependFieldsWithTableName($fields, $tableName);
411411
})

0 commit comments

Comments
 (0)