DadosIndividuaisBoleto   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 12
c 1
b 0
f 0
dl 0
loc 21
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A setDados() 0 12 2
1
<?php
2
namespace Itau\API\BoleCode;
3
4
use Itau\API\TraitEntity;
5
use JsonSerializable;
6
7
class DadosIndividuaisBoleto implements JsonSerializable
8
{
9
    use TraitEntity;
10
11
    private string $numero_nosso_numero;
12
    private string $data_vencimento;
13
    private string $valor_titulo;
14
    private string $data_limite_pagamento;
15
16
    public function setDados(
17
        string $nossoNumero, string $dataVencimento, string $valor, ?string $limitePagamento = null
18
    ): self
19
    {
20
        $this->numero_nosso_numero = str_pad($nossoNumero, 8, '0', STR_PAD_LEFT);
21
        $this->data_vencimento = $dataVencimento;
22
        $this->valor_titulo = ($valor*100);
23
        if(!empty($limitePagamento)){
24
            $this->data_limite_pagamento = $limitePagamento;
25
        }
26
        
27
        return $this;
28
    }
29
}