GSCPSettersTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
c 1
b 0
f 0
dl 0
loc 30
ccs 9
cts 9
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setLocale() 0 4 1
A setColumns() 0 4 1
A setFilename() 0 4 1
1
<?php
2
namespace GSCP;
3
4
trait GSCPSettersTrait
5
{
6
    /**
7
     * @param string $filename
8
     * @return self
9
     */
10 3
    public function setFilename(string $filename): self
11
    {
12 3
        $this->filename = $filename;
0 ignored issues
show
Bug Best Practice introduced by
The property filename does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
13 3
        return $this;
14
    }
15
16
    /**
17
     * @param string $locale
18
     * @return self
19
     */
20 2
    public function setLocale(string $locale): self
21
    {
22 2
        $this->locale = str_replace('_', '-', $locale);
0 ignored issues
show
Bug Best Practice introduced by
The property locale does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
23 2
        return $this;
24
    }
25
26
    /**
27
     * @param array $columns
28
     * @return self
29
     */
30 1
    public function setColumns(array $columns): self
31
    {
32 1
        $this->columns = $columns;
0 ignored issues
show
Bug Best Practice introduced by
The property columns does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
33 1
        return $this;
34
    }
35
}