Skip to content

Commit

Permalink
Criação do método limpaTelefone na classe helper Util [Issue #764]
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielPintoSouza committed Oct 24, 2024
1 parent fafacfa commit f5deabe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions html/apoio/helper/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,11 @@ public static function limpaCpf($cpf)
{
return preg_replace('/\D/', '', $cpf);
}

/**
* Retorna apenas os números de um telefone
*/
public static function limpaTelefone(string $telefone){
return preg_replace('/\D/', '', $telefone);
}
}
2 changes: 1 addition & 1 deletion html/apoio/service/PagarMePixService.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function gerarQrCode(ContribuicaoLog $contribuicaoLog)
//gerar um número aleatório para o parâmetro code
$code = $contribuicaoLog->getCodigo();
$cpfSemMascara = Util::limpaCpf($contribuicaoLog->getSocio()->getDocumento());
$telefone = preg_replace('/\D/', '', $contribuicaoLog->getSocio()->getTelefone());
$telefone = Util::limpaTelefone($contribuicaoLog->getSocio()->getTelefone());

$data = [
'items' => [
Expand Down

0 comments on commit f5deabe

Please sign in to comment.