Completed
Push — master ( eb8200...210d5d )
by Freek
01:23
created

SearchAspect::canBeUsedBy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Spatie\Searchable;
4
5
use Illuminate\Support\Collection;
6
use Illuminate\Foundation\Auth\User;
7
8
abstract class SearchAspect
9
{
10
    abstract public function getResults(string $term, ?User $user = null): Collection;
11
12
    public function getType(): string
13
    {
14
        $className = class_basename(static::class);
15
16
        $type = str_before($className, 'SearchAspect');
17
18
        $type = snake_case(str_plural($type));
19
20
        return str_plural($type);
21
    }
22
}
23