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

TransChoiceSubAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
namespace W2w\Laravel\Apie\Plugins\IlluminateTranslation\SubActions;
4
5
use Illuminate\Contracts\Translation\Translator;
6
use W2w\Laravel\Apie\Plugins\IlluminateTranslation\ApiResources\Translation;
7
8
class TransChoiceSubAction
9
{
10
    /**
11
     * @var Translator
12
     */
13
    private $translator;
14
15
    public function __construct(Translator $translator)
16
    {
17
        $this->translator = $translator;
18
    }
19
20
    public function handle(Translation $translation, array $replace = [], int $amount = 1): string
21
    {
22
        return $this->translator->transChoice($translation->getId(), $amount, $replace);
23
    }
24
}
25