Passed
Push — master ( c49c81...0c069c )
by Ferry
03:05
created

Money   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 18
dl 0
loc 34
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A prefix() 0 6 1
A decimalSeparator() 0 6 1
A precision() 0 6 1
A thousandSeparator() 0 6 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: User
5
 * Date: 1/26/2019
6
 * Time: 6:00 PM
7
 */
8
9
namespace crocodicstudio\crudbooster\types;
10
11
use crocodicstudio\crudbooster\controllers\scaffolding\traits\DefaultOption;
12
use crocodicstudio\crudbooster\controllers\scaffolding\traits\Join;
13
use crocodicstudio\crudbooster\types\money\MoneyModel;
14
15
class Money
16
{
17
    use DefaultOption, Join;
18
19
    public function prefix($prefix) {
20
        $data = columnSingleton()->getColumn($this->index);
21
        /** @var $data MoneyModel */
22
        $data->setPrefix($prefix);
23
        columnSingleton()->setColumn($this->index, $data);
24
        return $this;
25
    }
26
27
    public function precision($precision) {
28
        $data = columnSingleton()->getColumn($this->index);
29
        /** @var $data MoneyModel */
30
        $data->setPrecision($precision);
31
        columnSingleton()->setColumn($this->index, $data);
32
        return $this;
33
    }
34
35
    public function thousandSeparator($separator) {
0 ignored issues
show
Unused Code introduced by
The parameter $separator is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

35
    public function thousandSeparator(/** @scrutinizer ignore-unused */ $separator) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
36
        $data = columnSingleton()->getColumn($this->index);
37
        /** @var $data MoneyModel */
38
        $data->setThousands($precision);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $precision seems to be never defined.
Loading history...
39
        columnSingleton()->setColumn($this->index, $data);
40
        return $this;
41
    }
42
43
    public function decimalSeparator($separator) {
44
        $data = columnSingleton()->getColumn($this->index);
45
        /** @var $data MoneyModel */
46
        $data->setDecimal($separator);
47
        columnSingleton()->setColumn($this->index, $data);
48
        return $this;
49
    }
50
}