Skip to content

Commit

Permalink
valida array instrucoes
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardokum committed Oct 11, 2024
1 parent 2ed63e1 commit 828e24c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Boleto/AbstractBoleto.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ abstract class AbstractBoleto implements BoletoContract
/**
* Array com as linhas do demonstrativo (descrição do pagamento)
*
* @var array
* @var array|null
*/
protected $descricaoDemonstrativo;

Expand All @@ -327,14 +327,14 @@ abstract class AbstractBoleto implements BoletoContract
/**
* Array com as linhas de instruções
*
* @var array
* @var array|null
*/
protected $instrucoes = ['Pagar até a data do vencimento.'];

/**
* Array com as linhas de instruções de impressão
*
* @var array
* @var array|null
*/
protected $instrucoes_impressao = [];

Expand Down Expand Up @@ -1132,7 +1132,7 @@ public function setInstrucoes(array $instrucoes)
*/
public function getInstrucoes()
{
return array_slice($this->instrucoes + [null, null, null, null, null, null, null, null], 0, 8);
return array_slice(((array) $this->instrucoes) + [null, null, null, null, null, null, null, null], 0, 8);
}

/**
Expand Down Expand Up @@ -1161,7 +1161,7 @@ public function setInstrucoesImpressao(array $instrucoes_impressao)
public function getInstrucoesImpressao()
{
if (! empty($this->instrucoes_impressao)) {
return array_slice($this->instrucoes_impressao + [null, null, null, null, null], 0, 5);
return array_slice(((array) $this->instrucoes_impressao) + [null, null, null, null, null], 0, 5);
} else {
return [];
}
Expand Down Expand Up @@ -1210,7 +1210,7 @@ public function setDescricaoDemonstrativo(array $descricaoDemonstrativo)
*/
public function getDescricaoDemonstrativo()
{
return array_slice($this->descricaoDemonstrativo + [null, null, null, null, null], 0, 5);
return array_slice(((array) $this->descricaoDemonstrativo) + [null, null, null, null, null], 0, 5);
}

/**
Expand Down

0 comments on commit 828e24c

Please sign in to comment.