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

TransactionTransformer::transform()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 17
nc 1
nop 1
1
<?php
2
3
namespace App\Transformers\Mmex;
4
5
use App\Models\Transaction;
6
use League\Fractal\TransformerAbstract;
7
use Spatie\MediaLibrary\Media;
8
9
class TransactionTransformer extends TransformerAbstract
10
{
11
    /**
12
     * A Fractal transformer.
13
     *
14
     * @param Transaction $item
15
     *
16
     * @return array
17
     */
18
    public function transform(Transaction $item)
19
    {
20
        return [
21
            'ID'          => $item->id,
22
            'Date'        => $item->date,
23
            'Account'     => $item->account_name,
24
            'ToAccount'   => $item->to_account_name,
25
            'Status'      => $item->status->slug,
26
            'Type'        => $item->type->name,
27
            'Payee'       => $item->payee_name,
28
            'Category'    => $item->category_name,
29
            'SubCategory' => $item->sub_category_name,
30
            'Amount'      => (string)floatval($item->amount),
31
            'Notes'       => $item->notes,
32
            'Attachments' => $item->getMedia('attachments')
33
                ->map(function (Media $mediaItem) {
34
                    return $mediaItem->file_name;
35
                })->implode(';'),];
36
    }
37
}
38