Passed
Push — 10.x ( 8fb11f...b38d0c )
by Andrey
38:18 queued 23:18
created

Arrayable   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A sort() 0 3 1
A sortAndMerge() 0 5 1
A combine() 0 3 1
A merge() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Helldar\LaravelLangPublisher\Concerns;
6
7
use Helldar\Support\Facades\Helpers\Arr;
8
9
trait Arrayable
10
{
11
    protected function combine(array ...$arrays): array
12
    {
13
        return Arr::combine($arrays);
14
    }
15
16
    protected function merge(array ...$arrays): array
17
    {
18
        return Arr::merge(...$arrays);
19
    }
20
21
    protected function sort(array $array): array
22
    {
23
        return Arr::ksort($array);
24
    }
25
26
    protected function sortAndMerge(array ...$arrays): array
27
    {
28
        $array = $this->merge(...$arrays);
29
30
        return $this->sort($array);
31
    }
32
}
33