Completed
Push — v3 ( 320a43...25ab4d )
by Fèvre
04:54
created

AppTranslateTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 19
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A setTranslations() 0 8 3
1
<?php
2
namespace App\Model\Behavior;
3
4
trait AppTranslateTrait
5
{
6
7
    /**
8
     * Set the transaltions to be saved.
9
     *
10
     * @param array $data The data to save.
11
     *
12
     * @return void
13
     */
14
    public function setTranslations($data = [])
15
    {
16
        if (array_key_exists('translations', $data)) {
17
            foreach ($data['translations'] as $locale => $dataLocale) {
18
                $this->translation($locale)->set($dataLocale, ['guard' => false]);
0 ignored issues
show
Bug introduced by
The method translation() does not exist on App\Model\Behavior\AppTranslateTrait. Did you maybe mean setTranslations()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
19
            }
20
        }
21
    }
22
}
23