Skip to content

Commit

Permalink
Update Exception file and be more verbose.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jun 15, 2021
1 parent 7b42ac4 commit 2ddfca9
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/Exception/TINException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<?php

/**
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/

declare(strict_types=1);

namespace loophp\Tin\Exception;
Expand All @@ -16,23 +21,23 @@ public static function invalidCountry(string $countryCode): TINException
return new self(sprintf('No handler available for this country code: %s.', $countryCode));
}

public static function invalidDate(): TINException
public static function invalidDate(string $tin): TINException
{
return new self('Invalid date.');
return new self(sprintf('Invalid TIN(%s). Reason: Invalid date.', $tin));
}

public static function invalidLength(): TINException
public static function invalidLength(string $tin): TINException
{
return new self('Invalid length.');
return new self(sprintf('Invalid TIN(%s). Reason: Invalid length.', $tin));
}

public static function invalidPattern(): TINException
public static function invalidPattern(string $tin): TINException
{
return new self('Invalid pattern.');
return new self(sprintf('Invalid TIN(%s). Reason: Invalid pattern.', $tin));
}

public static function invalidSyntax(): TINException
public static function invalidSyntax(string $tin): TINException
{
return new self('Invalid syntax.');
return new self(sprintf('Invalid TIN(%s). Reason: Invalid syntax.', $tin));
}
}

0 comments on commit 2ddfca9

Please sign in to comment.