These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * Finance module for HiPanel |
||
4 | * |
||
5 | * @link https://github.com/hiqdev/hipanel-module-finance |
||
6 | * @package hipanel-module-finance |
||
7 | * @license BSD-3-Clause |
||
8 | * @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/) |
||
9 | */ |
||
10 | |||
11 | return [ |
||
12 | 'aliases' => [ |
||
13 | '@bill' => '/finance/bill', |
||
14 | '@purse' => '/finance/purse', |
||
15 | '@tariff' => '/finance/tariff', |
||
16 | '@sale' => '/finance/sale', |
||
17 | '@pay' => '/merchant/pay', |
||
18 | '@cart' => '/cart/cart', |
||
19 | '@finance' => '/finance', |
||
20 | '@plan' => '/finance/plan', |
||
21 | '@price' => '/finance/price', |
||
22 | '@tariffprofile' => '/finance/tariff-profile', |
||
23 | ], |
||
24 | 'modules' => [ |
||
25 | 'finance' => [ |
||
26 | 'class' => \hipanel\modules\finance\Module::class, |
||
27 | ], |
||
28 | 'cart' => array_filter([ |
||
29 | 'class' => \hiqdev\yii2\cart\Module::class, |
||
30 | 'termsPage' => $params['organization.termsUrl'] ?: $params['organization.url'], |
||
31 | 'orderPage' => '/finance/cart/select', |
||
32 | /*'orderButton' => function ($module) { |
||
33 | return Yii::$app->getView()->render('@hipanel/modules/finance/views/cart/order-button', [ |
||
34 | 'module' => $module, |
||
35 | ]); |
||
36 | },*/ |
||
37 | 'paymentMethods' => function () { |
||
38 | $merchants = Yii::$app->getModule('merchant')->getPurchaseRequestCollection( |
||
39 | new \hiqdev\yii2\merchant\models\DepositRequest(['amount' => 5]) |
||
40 | )->getItems(); |
||
41 | |||
42 | return Yii::$app->getView()->render('@hipanel/modules/finance/views/cart/payment-methods', [ |
||
43 | 'merchants' => $merchants, |
||
44 | ]); |
||
45 | }, |
||
46 | 'shoppingCartOptions' => [ |
||
47 | 'on cartChange' => [\hipanel\modules\finance\cart\CartCalculator::class, 'handle'], |
||
48 | 'session' => \yii\di\Instance::of(\hipanel\modules\finance\cart\storage\CartStorageInterface::class), |
||
49 | ], |
||
50 | ]), |
||
51 | 'merchant' => [ |
||
52 | 'class' => \hiqdev\yii2\merchant\Module::class, |
||
53 | 'returnPage' => '/finance/pay/return', |
||
54 | 'notifyPage' => '/finance/pay/notify', |
||
55 | 'finishPage' => '/finance/bill', |
||
56 | 'purchaseRequestCollectionClass' => \hipanel\modules\finance\merchant\PurchaseRequestCollection::class, |
||
57 | 'currenciesCollectionClass' => \hipanel\modules\finance\merchant\CurrenciesCollection::class, |
||
58 | ], |
||
59 | ], |
||
60 | 'components' => [ |
||
61 | 'urlManager' => [ |
||
62 | 'rules' => [ |
||
63 | [ |
||
64 | 'pattern' => 'finance/purse/<id:\d+>/generate/monthly/<type:\w+>.<login:[.\@\w\d_]+>.<currency:\w+>.<month:[\d-]+>.pdf', |
||
65 | 'route' => 'finance/purse/generate-monthly-document', |
||
66 | ], |
||
67 | [ |
||
68 | 'pattern' => 'finance/purse/<id:\d+>/generate/<type:\w+>.<login:[.\@\w\d_]+>.<currency:\w+>.pdf', |
||
69 | 'route' => 'finance/purse/generate-document', |
||
70 | ], |
||
71 | [ |
||
72 | 'pattern' => 'finance/pay/return/<username:.+>/<merchant:[\w\d_]+>/<transactionId:[\w\d]+>', |
||
73 | 'route' => 'finance/pay/return', |
||
74 | ], |
||
75 | ], |
||
76 | ], |
||
77 | 'themeManager' => [ |
||
78 | 'pathMap' => [ |
||
79 | '@hipanel/modules/finance/views' => '$themedViewPaths', |
||
80 | ], |
||
81 | ], |
||
82 | 'i18n' => [ |
||
83 | 'translations' => [ |
||
84 | 'hipanel:finance' => [ |
||
85 | 'class' => \yii\i18n\PhpMessageSource::class, |
||
86 | 'basePath' => '@hipanel/modules/finance/messages', |
||
87 | ], |
||
88 | 'hipanel:finance:change' => [ |
||
89 | 'class' => \yii\i18n\PhpMessageSource::class, |
||
90 | 'basePath' => '@hipanel/modules/finance/messages', |
||
91 | ], |
||
92 | 'hipanel:finance:tariff' => [ |
||
93 | 'class' => \yii\i18n\PhpMessageSource::class, |
||
94 | 'basePath' => '@hipanel/modules/finance/messages', |
||
95 | ], |
||
96 | 'hipanel.finance.units' => [ |
||
97 | 'class' => \yii\i18n\PhpMessageSource::class, |
||
98 | 'basePath' => '@hipanel/modules/finance/messages', |
||
99 | ], |
||
100 | 'hipanel:finance:tariff:types' => [ |
||
101 | 'class' => \yii\i18n\PhpMessageSource::class, |
||
102 | 'basePath' => '@hipanel/modules/finance/messages', |
||
103 | 'forceTranslation' => true, |
||
104 | ], |
||
105 | 'hipanel:finance:deposit' => [ |
||
106 | 'class' => \yii\i18n\PhpMessageSource::class, |
||
107 | 'basePath' => '@hipanel/modules/finance/messages', |
||
108 | ], |
||
109 | 'hipanel:finance:sale' => [ |
||
110 | 'class' => \yii\i18n\PhpMessageSource::class, |
||
111 | 'basePath' => '@hipanel/modules/finance/messages', |
||
112 | ], |
||
113 | 'hipanel.finance.suggestionTypes' => [ |
||
114 | 'class' => \yii\i18n\PhpMessageSource::class, |
||
115 | 'basePath' => '@hipanel/modules/finance/messages', |
||
116 | ], |
||
117 | 'hipanel.finance.price' => [ |
||
118 | 'class' => \yii\i18n\PhpMessageSource::class, |
||
119 | 'basePath' => '@hipanel/modules/finance/messages', |
||
120 | ], |
||
121 | 'hipanel.finance.billTypes' => [ |
||
122 | 'class' => \yii\i18n\PhpMessageSource::class, |
||
123 | 'basePath' => '@hipanel/modules/finance/messages', |
||
124 | ], |
||
125 | 'hipanel.finance.plan' => [ |
||
126 | 'class' => \yii\i18n\PhpMessageSource::class, |
||
127 | 'basePath' => '@hipanel/modules/finance/messages', |
||
128 | ], |
||
129 | 'hipanel.finance.tariffprofile' => [ |
||
130 | 'class' => \yii\i18n\PhpMessageSource::class, |
||
131 | 'basePath' => '@hipanel/modules/finance/messages', |
||
132 | ], |
||
133 | ], |
||
134 | ], |
||
135 | ], |
||
136 | 'container' => [ |
||
137 | 'definitions' => [ |
||
138 | \hipanel\modules\dashboard\menus\DashboardMenu::class => [ |
||
139 | 'add' => [ |
||
140 | 'finance' => [ |
||
141 | 'menu' => [ |
||
142 | 'class' => \hipanel\modules\finance\menus\DashboardItem::class, |
||
143 | ], |
||
144 | 'where' => [ |
||
145 | 'after' => ['clients', 'dashboard'], |
||
146 | 'before' => ['tickets', 'domains', 'servers', 'hosting'], |
||
147 | ], |
||
148 | ], |
||
149 | ], |
||
150 | ], |
||
151 | \hiqdev\thememanager\menus\AbstractSidebarMenu::class => [ |
||
152 | 'add' => [ |
||
153 | 'finance' => [ |
||
154 | 'menu' => \hipanel\modules\finance\menus\SidebarMenu::class, |
||
155 | 'where' => [ |
||
156 | 'after' => ['clients', 'dashboard'], |
||
157 | 'before' => ['tickets', 'domains', 'servers', 'hosting'], |
||
158 | ], |
||
159 | ], |
||
160 | ], |
||
161 | ], |
||
162 | \hiqdev\yii2\merchant\widgets\PayButton::class => [ |
||
163 | 'class' => \hiqdev\yii2\merchant\widgets\PayButton::class, |
||
164 | 'action' => ['@finance/pay/request'], |
||
165 | 'as commentBehavior' => [ |
||
166 | 'class' => \hipanel\modules\finance\behaviors\PayButtonCommentBehavior::class, |
||
167 | ], |
||
168 | ], |
||
169 | \hipanel\modules\finance\logic\ServerTariffCalculatorInterface::class => \hipanel\modules\finance\logic\CalculatorInterface::class, |
||
170 | \hipanel\modules\finance\logic\CalculatorInterface::class => \hipanel\modules\finance\logic\Calculator::class, |
||
171 | ], |
||
172 | 'singletons' => [ |
||
173 | hipanel\modules\finance\providers\BillTypesProvider::class => hipanel\modules\finance\providers\BillTypesProvider::class, |
||
174 | hiqdev\yii2\merchant\transactions\TransactionRepositoryInterface::class => hipanel\modules\finance\transaction\ApiTransactionRepository::class, |
||
175 | hipanel\modules\finance\logic\bill\QuantityFormatterFactoryInterface::class => hipanel\modules\finance\logic\bill\QuantityFormatterFactory::class, |
||
176 | hipanel\modules\finance\models\ServerResourceTypesProviderInterface::class => hipanel\modules\finance\models\ServerResourceTypesProvider::class, |
||
177 | hipanel\modules\finance\cart\storage\CartStorageInterface::class => function (yii\di\Container $container) { |
||
178 | return hipanel\modules\finance\cart\storage\CartStorageFactory::forUser($container->get(\yii\web\User::class)); |
||
179 | }, |
||
180 | \hipanel\modules\finance\models\factories\PriceModelFactory::class => \hipanel\modules\finance\models\factories\PriceModelFactory::class, |
||
181 | \hipanel\modules\finance\grid\presenters\price\PricePresenterFactory::class => \hipanel\modules\finance\grid\presenters\price\PricePresenterFactory::class, |
||
182 | \hipanel\modules\finance\widgets\FormulaHelpModal::class => \hipanel\modules\finance\widgets\FormulaHelpModal::class, |
||
183 | |||
184 | \Money\Currencies::class => function (\yii\di\Container $container) { |
||
0 ignored issues
–
show
|
|||
185 | return new \Money\Currencies\AggregateCurrencies([ |
||
186 | new \Money\Currencies\ISOCurrencies(), |
||
187 | ]); |
||
188 | }, |
||
189 | \Money\MoneyFormatter::class => function (\yii\di\Container $container) { |
||
190 | return new \Money\Formatter\IntlMoneyFormatter( |
||
191 | new NumberFormatter(Yii::$app->language, \NumberFormatter::CURRENCY), |
||
192 | $container->get(Money\Currencies::class) |
||
193 | ); |
||
194 | }, |
||
195 | \Money\MoneyParser::class => \Money\Parser\DecimalMoneyParser::class, |
||
196 | ], |
||
197 | ], |
||
198 | ]; |
||
199 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.