Test Setup Failed
Pull Request — master (#150)
by Nick
14:47 queued 06:28
created

LanguageResource::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 1
c 2
b 0
f 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * Language Resource.
4
 *
5
 * @package App\Http\Resources\Language
6
 *
7
 * @author    Nick Menke <[email protected]>
8
 * @copyright 2018-2020 Nick Menke
9
 *
10
 * @link https://github.com/nlmenke/vertebrae
11
 */
12
13
declare(strict_types=1);
14
15
namespace App\Http\Resources\Language;
16
17
use App\Entities\Language\Language;
18
use App\Http\Resources\AbstractResource;
19
use Illuminate\Http\Request;
20
21
/**
22
 * The Language resource class.
23
 *
24
 * This class transforms language models into JSON responses for your API.
25
 *
26
 * @since x.x.x introduced
27
 */
28
class LanguageResource extends AbstractResource
29
{
30
    /**
31
     * Create a new resource instance.
32
     *
33
     * @param Language $resource
34
     *
35
     * @return void
36
     */
37 7
    public function __construct(Language $resource)
38
    {
39 7
        parent::__construct($resource);
40 7
    }
41
42
    /**
43
     * Transform the resource into an array.
44
     *
45
     * @param Request $request
46
     *
47
     * @return array
48
     */
49 5
    public function toArray($request): array
50
    {
51 5
        return parent::toArray($request);
52
    }
53
}
54