-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontainer.php
86 lines (66 loc) · 2.91 KB
/
container.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
declare(strict_types=1);
// Core
$container->add("Pdo", PDO::class)
->addArgument("mysql:dbname={$_ENV["DB_NAME"]};host={$_ENV["DB_HOST"]}")
->addArgument($_ENV["DB_USER"])
->addArgument($_ENV["DB_PASS"])
->addArgument([]);
$container->add("Database", Bank\Database\PdoDatabase::class)
->addArgument("Pdo");
// Account
$container->add("AccountRepository", Bank\Account\AccountRepository::class)
->addArgument("Database");
$container->add("AccountService", Bank\Account\AccountService::class)
->addArgument("AccountRepository");
$container->add(Bank\Account\AccountController::class)
->addArgument("AccountService");
// Branch
$container->add("BranchRepository", Bank\Branch\BranchRepository::class)
->addArgument("Database");
$container->add("BranchService", Bank\Branch\BranchService::class)
->addArgument("BranchRepository");
$container->add(Bank\Branch\BranchController::class)
->addArgument("BranchService");
// Card
$container->add("CardRepository", Bank\Card\CardRepository::class)
->addArgument("Database");
$container->add("CardService", Bank\Card\CardService::class)
->addArgument("CardRepository");
$container->add(Bank\Card\CardController::class)
->addArgument("CardService");
// Customer
$container->add("CustomerRepository", Bank\Customer\CustomerRepository::class)
->addArgument("Database");
$container->add("CustomerService", Bank\Customer\CustomerService::class)
->addArgument("CustomerRepository");
$container->add(Bank\Customer\CustomerController::class)
->addArgument("CustomerService");
// CustomerBranch
$container->add("CustomerBranchRepository", Bank\CustomerBranch\CustomerBranchRepository::class)
->addArgument("Database");
$container->add("CustomerBranchService", Bank\CustomerBranch\CustomerBranchService::class)
->addArgument("CustomerBranchRepository");
$container->add(Bank\CustomerBranch\CustomerBranchController::class)
->addArgument("CustomerBranchService");
// Loan
$container->add("LoanRepository", Bank\Loan\LoanRepository::class)
->addArgument("Database");
$container->add("LoanService", Bank\Loan\LoanService::class)
->addArgument("LoanRepository");
$container->add(Bank\Loan\LoanController::class)
->addArgument("LoanService");
// LoanType
$container->add("LoanTypeRepository", Bank\LoanType\LoanTypeRepository::class)
->addArgument("Database");
$container->add("LoanTypeService", Bank\LoanType\LoanTypeService::class)
->addArgument("LoanTypeRepository");
$container->add(Bank\LoanType\LoanTypeController::class)
->addArgument("LoanTypeService");
// Transaction
$container->add("TransactionRepository", Bank\Transaction\TransactionRepository::class)
->addArgument("Database");
$container->add("TransactionService", Bank\Transaction\TransactionService::class)
->addArgument("TransactionRepository");
$container->add(Bank\Transaction\TransactionController::class)
->addArgument("TransactionService");