GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — rewrite-laravel ( 600c36...11aeee )
by Oliver
03:44
created

TransactionController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 5
dl 0
loc 25
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 22 2
1
<?php
2
3
namespace App\Http\Controllers\Api;
4
5
use App\Http\Controllers\Controller;
6
use App\Models\Transaction;
7
use App\Transformers\TransactionTransfomer;
8
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
9
10
class TransactionController extends Controller
11
{
12
    public function index()
13
    {
14
        $column = 'created_at';
15
        $direction = 'asc';
16
17
        // add support for sorting in vuetable-2
18
        $sort = request()->get('sort');
19
        if ($sort) {
20
            list($column, $direction) = explode('|', $sort);
21
        }
22
23
        $paginator = Transaction::query()
0 ignored issues
show
Bug introduced by
The method orderBy() does not exist on Illuminate\Database\Eloquent\Builder. Did you maybe mean enforceOrderBy()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
24
            ->orderBy($column, $direction)
25
            ->paginate(10);
26
27
        $transactions = $paginator->getCollection();
28
29
        return fractal()
30
            ->collection($transactions)
31
            ->transformWith(new TransactionTransfomer())
32
            ->paginateWith(new IlluminatePaginatorAdapter($paginator));
33
    }
34
}
35