| Conditions | 1 |
| Paths | 1 |
| Total Lines | 24 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | 15 | public function make(string $id, array $values): FormaDePago |
|
| 17 | { |
||
| 18 | 15 | unset($values['id']); |
|
| 19 | // the order of the arguments **must** be the same as in FormaDePago constructor |
||
| 20 | $defaults = [ |
||
| 21 | 'id' => $id, |
||
| 22 | 'texto' => $id, |
||
| 23 | 'esBancarizado' => false, |
||
| 24 | 'requiereNumeroDeOperacion' => false, |
||
| 25 | 'permiteBancoOrdenanteRfc' => false, |
||
| 26 | 'permiteCuentaOrdenante' => false, |
||
| 27 | 'patronCuentaOrdenante' => '', |
||
| 28 | 'permiteBancoBeneficiarioRfc' => false, |
||
| 29 | 'permiteCuentaBeneficiario' => false, |
||
| 30 | 'patronCuentaBeneficiario' => '', |
||
| 31 | 'permiteTipoCadenaPago' => false, |
||
| 32 | 'requiereBancoOrdenanteNombreExt' => false, |
||
| 33 | 'vigenteDesde' => 0, |
||
| 34 | 'vigenteHasta' => 0, |
||
| 35 | ]; |
||
| 36 | |||
| 37 | 15 | $values = array_values(array_intersect_key(array_merge($defaults, $values), $defaults)); |
|
| 38 | |||
| 39 | 15 | return new FormaDePago(...$values); /** @phpstan-ignore-line */ |
|
| 40 | } |
||
| 42 |