| 1 | <?php |
||
| 8 | class Bank |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Bank numbers constants. |
||
| 12 | */ |
||
| 13 | const BANCO_DO_BRASIL = 1; |
||
| 14 | const BRADESCO = 237; |
||
| 15 | const CAIXA = 104; |
||
| 16 | const ITAU = 341; |
||
| 17 | const SANTANDER = 33; |
||
| 18 | const SICOOB = 756; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Map for bank numbers and names. |
||
| 22 | * |
||
| 23 | * @var array |
||
| 24 | */ |
||
| 25 | protected static $banksMap = [ |
||
| 26 | self::BANCO_DO_BRASIL => 'BancoDoBrasil', |
||
| 27 | self::BRADESCO => 'Bradesco', |
||
| 28 | self::CAIXA => 'Caixa', |
||
| 29 | self::ITAU => 'Itau', |
||
| 30 | self::SANTANDER => 'Santander', |
||
| 31 | self::SICOOB => 'SICOOB', |
||
| 32 | ]; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Check if the received bank number is handled. |
||
| 36 | * |
||
| 37 | * @param mixed $number |
||
| 38 | * @return boolean |
||
| 39 | */ |
||
| 40 | public static function isHandled($number) |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Return the name of received bank number. |
||
| 47 | * |
||
| 48 | * @param mixed $number |
||
| 49 | * @return boolean |
||
| 50 | */ |
||
| 51 | public static function nameOfNumber($number) |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Return a bank support instance of received bank number. |
||
| 58 | * |
||
| 59 | * @param mixed $number |
||
| 60 | * @return \SmartCNAB\Contracts\Support\BankSupportInterface |
||
| 61 | */ |
||
| 62 | public static function ofNumber($number) |
||
| 69 | } |
||
| 70 |