Skip to content

Commit

Permalink
Merge pull request #55 from marciocvitor/patch-1
Browse files Browse the repository at this point in the history
Update Element.php
  • Loading branch information
robmachado authored Nov 13, 2024
2 parents 0c57f3c + d7aa805 commit a451e65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Common/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ protected function isFieldInError($input, $param, $fieldname, $element, $require
protected function validDoc(string $doc, string $field)
{
if ($doc != '0000000000000') {
if (substr($doc, 0, 3) == '000') {
if (substr($doc, 0, 3) == '000' and strlen($doc) < 14) {
$result = Documents\Cpf::createFromString($doc);
} else {
$result = Documents\Cnpj::createFromString($doc);
Expand Down

0 comments on commit a451e65

Please sign in to comment.