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

TransactionTransfomer::transform()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 25
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 20
nc 1
nop 1
1
<?php
2
3
namespace App\Transformers;
4
5
use App\Models\Transaction;
6
use League\Fractal\TransformerAbstract;
7
8
class TransactionTransfomer extends TransformerAbstract
9
{
10
    /**
11
     * A Fractal transformer.
12
     *
13
     * @return array
14
     */
15
    public function transform(Transaction $item)
16
    {
17
        return [
18
            'id'                => $item->id,
19
            'status'            => [
20
                'id'   => $item->status->id,
21
                'name' => $item->status->name,
22
                'slug' => $item->status->slug
23
            ],
24
            'type'              => [
25
                'id'   => $item->type->id,
26
                'name' => $item->type->name,
27
                'slug' => $item->type->slug
28
            ],
29
            'account_name'      => $item->account_name,
30
            'to_account_name'   => $item->to_account_name,
31
            'payee_name'        => $item->payee_name,
32
            'category_name'     => $item->category_name,
33
            'sub_category_name' => $item->sub_category_name,
34
            'amount'            => round($item->amount, 2),
35
            'notes'             => $item->notes,
36
            'created_at'        => $item->created_at->toIso8601String(),
37
            'updated_at'        => $item->updated_at->toIso8601String()
38
        ];
39
    }
40
}
41