CitationTable::templatePath()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace App\Tables\Builders;
4
5
use App\Citation;
6
use Illuminate\Database\Eloquent\Builder;
7
use LaravelEnso\Tables\Contracts\Table;
8
9
class CitationTable implements Table
10
{
11
    protected const TemplatePath = __DIR__.'/../Templates/citations.json';
12
13
    public function query(): Builder
14
    {
15
        return Citation::select(\DB::raw('
0 ignored issues
show
Bug Best Practice introduced by
The expression return App\Citation::sel...id', '=', 'sources.id') could return the type Illuminate\Database\Query\Builder which is incompatible with the type-hinted return Illuminate\Database\Eloquent\Builder. Consider adding an additional type-check to rule them out.
Loading history...
16
            citations.id as "dtRowId", citations.name as name, citations.description as description, citations.volume as volume,
17
 citations.page as page, citations.confidence as confidence, citations.is_active as is_active,
18
 citations.date as date, citations.created_at as created_at, sources.name as source
19
        '))->join('sources', 'citations.source_id', '=', 'sources.id');
20
    }
21
22
    public function templatePath(): string
23
    {
24
        return static::TemplatePath;
25
    }
26
}
27