File400::mutateDetailLateInterestFlag()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 2
1
<?php
2
3
namespace SmartCNAB\Services\Remittances\Banks\Bradesco;
4
5
use SmartCNAB\Support\File\Remittance;
6
7
/**
8
 * Class for Bradesco remittance CNAB 400 layout.
9
 */
10
class File400 extends Remittance
11
{
12
    /**
13
     * File schema file.
14
     *
15
     * @var string
16
     */
17
    protected $schemaFile = '/schemas/400.json';
18
19
    /**
20
     * Mutates a discount to date.
21
     *
22
     * @param  mixed  $value
23
     * @param  array  $data
24
     * @return mixed
25
     */
26
    protected function mutateDetailDiscountTo(
27
        $value,
28
        array $data = []
29
    ) {
30
        return $value ?: $data['expiration'];
31
    }
32
33
    /**
34
     * Mutates the late interest flag based on late interest percentage.
35
     *
36
     * @param  mixed  $value
37
     * @param  array  $data
38
     * @return mixed
39
     */
40
    protected function mutateDetailLateInterestFlag(
41
        $value,
0 ignored issues
show
Unused Code introduced by
The parameter $value is not used and could be removed.

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

Loading history...
42
        array $data = []
43
    ) {
44
        return ( ! empty($data['lateInterestPercentage'])) ? 2 : 0;
45
    }
46
}
47