Passed
Push — master ( 3b7f4e...63066e )
by Pieter
05:16
created

Translation   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 10
dl 0
loc 52
rs 10
c 1
b 0
f 1
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getLocale() 0 3 1
A getTranslation() 0 3 1
A getId() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
namespace W2w\Laravel\Apie\Plugins\IlluminateTranslation\ApiResources;
4
5
use W2w\Lib\Apie\Annotations\ApiResource;
6
use W2w\Laravel\Apie\Plugins\IlluminateTranslation\DataLayers\TranslationRetriever;
7
use W2w\Laravel\Apie\Plugins\IlluminateTranslation\ValueObjects\Locale;
8
9
/**
10
 * @ApiResource(
11
 *     retrieveClass=TranslationRetriever::class,
12
 *     disabledMethods={"get-all"}
13
 * )
14
 */
15
class Translation
16
{
17
    /**
18
     * @var string
19
     */
20
    private $id;
21
22
    /**
23
     * @var string
24
     */
25
    private $translation;
26
27
    /**
28
     * @var Locale
29
     */
30
    private $locale;
31
32
    public function __construct(string $id, string $translation, Locale $locale)
33
    {
34
        $this->id = $id;
35
        $this->translation = $translation;
36
        $this->locale = $locale;
37
    }
38
39
    /**
40
     * Get the id.
41
     *
42
     * @return string
43
     */
44
    public function getId(): string
45
    {
46
        return $this->id;
47
    }
48
49
    /**
50
     * Get the translation.
51
     *
52
     * @return string
53
     */
54
    public function getTranslation(): string
55
    {
56
        return $this->translation;
57
    }
58
59
    /**
60
     * Get the locale.
61
     *
62
     * @return Locale
63
     */
64
    public function getLocale(): Locale
65
    {
66
        return $this->locale;
67
    }
68
}
69