You are here

public function BrazilianIdsServiceInterface::validateCpfCnpj in Brazilian IDs 8

Validates CPF or CNPJ numbers depending on the number of digits.

Parameters

string $value: The value of the CPF or CNPJ number to be validated.

array $error: If provided, it is filled with the error message at $error['message'] if any.

Return value

bool Returns TRUE if the CPF or CNPJ number is valid. Otherwise, returns FALSE.

1 method overrides BrazilianIdsServiceInterface::validateCpfCnpj()
BrazilianIdsService::validateCpfCnpj in src/BrazilianIdsService.php
Validates CPF or CNPJ numbers depending on the number of digits.

File

src/BrazilianIdsServiceInterface.php, line 55

Class

BrazilianIdsServiceInterface
Defines the interface of the Brazilian IDs service.

Namespace

Drupal\brazilian_ids

Code

public function validateCpfCnpj($value, array &$error = []);