| 1 | <?php |
||
| 7 | final class PisPasep implements DocumentInterface |
||
| 8 | { |
||
| 9 | const REGEX = '/^([\d]{3})([\d]{5})([\d]{2})([\d]{1})$/'; |
||
| 10 | |||
| 11 | const FORMAT_REGEX = '/^[\d]{3}\.[\d]{5}\.[\d]{2}-[\d]{1}$/'; |
||
| 12 | |||
| 13 | private $pispasep; |
||
| 14 | |||
| 15 | protected $mask = '000.00000.00-0'; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * PisPasep constructor. |
||
| 19 | * |
||
| 20 | * @param $pispasep |
||
| 21 | */ |
||
| 22 | 9 | public function __construct($pispasep) |
|
| 27 | |||
| 28 | 9 | private function validate($pispasep) |
|
| 37 | |||
| 38 | 6 | private function isValidCV($pispasep) |
|
| 47 | |||
| 48 | /** |
||
| 49 | * Formats PIS/PASEP number |
||
| 50 | * |
||
| 51 | * @return string Returns formatted number, such as: 00.00000.00-0 |
||
| 52 | */ |
||
| 53 | 2 | public function format() |
|
| 57 | |||
| 58 | public function __toString() |
||
| 62 | } |