-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteste-deposito.php
42 lines (37 loc) · 963 Bytes
/
teste-deposito.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
use Alura\Banco\Model\Conta\ContaCorrente;
use Alura\Banco\Model\Conta\Titular;
use Alura\Banco\Model\CPF;
use Alura\Banco\Model\Endereco;
require_once 'vendor/autoload.php';
$contaCorrente = new ContaCorrente(
new Titular(
new CPF('454.104.348-38'),
'Kayke Galdiano',
new Endereco(
'Ribeirão Preto',
'Vila Virginia',
'Rua Julio de Mesquita',
'1392'
)
)
);
try {
$contaCorrente->deposita(-100);
} catch (InvalidArgumentException $e) {
echo $e->getMessage();
}
// try {
// $kayke = new Titular(
// new CPF('454.104.348-38'),
// 'Ana Banana',
// new Endereco(
// 'Ribeirão',
// 'Vila',
// 'Rua',
// '1234'
// )
// );
// } catch (InvalidArgumentException | LengthException $e) {
// echo $e->getMessage();
// }