| 1 |
<?php |
| 2 |
|
| 3 |
if (!defined('ABSPATH')) { |
| 4 |
exit; // Exit if accessed directly |
| 5 |
} |
| 6 |
|
| 7 |
use IvyForms\Services\Menu\MenuManager; |
| 8 |
use IvyForms\Services\Menu\MenuMapper; |
| 9 |
use IvyForms\Services\Menu\MenuService; |
| 10 |
use IvyForms\Services\Integrations\PluginInstaller; |
| 11 |
use IvyForms\Services\Integrations\IntegrationRegistry; |
| 12 |
use IvyForms\Services\Integrations\IntegrationService; |
| 13 |
use IvyForms\Services\Permissions\PermissionResolver; |
| 14 |
use IvyForms\Services\Permissions\RoutePermissionService; |
| 15 |
use IvyForms\Controllers\Integrations\InstallPluginController; |
| 16 |
use IvyForms\Controllers\Integration\GetAllIntegrationsController; |
| 17 |
use IvyForms\Controllers\Integration\GetIntegrationController; |
| 18 |
use IvyForms\Controllers\Form\ExportFormController; |
| 19 |
use IvyForms\Controllers\Form\ImportFormController; |
| 20 |
use IvyForms\Services\Form\FormService; |
| 21 |
use IvyForms\Services\Form\FormImportExportService; |
| 22 |
use IvyForms\Services\Entry\EntryService; |
| 23 |
use IvyForms\Services\Field\FieldDuplicateValidationService; |
| 24 |
use IvyForms\Services\Field\FieldService; |
| 25 |
use IvyForms\Services\Mailer\MailerService; |
| 26 |
use IvyForms\Services\Notification\NotificationService; |
| 27 |
use IvyForms\Services\Security\SecurityService; |
| 28 |
use IvyForms\Services\Confirmation\ConfirmationService; |
| 29 |
use IvyForms\Services\Submission\FormSubmissionService; |
| 30 |
use IvyForms\Services\Submission\SubmissionDataFormatterService; |
| 31 |
use IvyForms\Services\Submission\SubmissionUploadService; |
| 32 |
use IvyForms\Services\GoogleSheets\Helpers\GoogleSheetsRequestSanitizer; |
| 33 |
use IvyForms\Services\GoogleSheets\Hooks\GoogleSheetsEntryHooks; |
| 34 |
use IvyForms\Services\GoogleSheets\Hooks\GoogleSheetsFormHooks; |
| 35 |
use IvyForms\Services\GoogleSheets\Hooks\InitializationHook as GoogleSheetsInitializationHook; |
| 36 |
use IvyForms\Repository\GoogleSheets\GoogleSheetsRepositoryInterface; |
| 37 |
use IvyForms\Services\GoogleSheets\GoogleSheetsDispatcherService; |
| 38 |
use IvyForms\Services\GoogleSheets\GoogleSheetsManagerService; |
| 39 |
use IvyForms\Services\GoogleSheets\GoogleSheetsService; |
| 40 |
use IvyForms\Controllers\GoogleSheets\GoogleSheetsConnectController; |
| 41 |
use IvyForms\Controllers\GoogleSheets\GoogleSheetsOAuthCallbackController; |
| 42 |
use IvyForms\Controllers\GoogleSheets\GoogleSheetsCreateController; |
| 43 |
use IvyForms\Controllers\GoogleSheets\GoogleSheetsDeleteController; |
| 44 |
use IvyForms\Controllers\GoogleSheets\GoogleSheetsDisconnectController; |
| 45 |
use IvyForms\Controllers\GoogleSheets\GoogleSheetsListColumnsController; |
| 46 |
use IvyForms\Controllers\GoogleSheets\GoogleSheetsListIntegrationsController; |
| 47 |
use IvyForms\Controllers\GoogleSheets\GoogleSheetsListSpreadsheetsController; |
| 48 |
use IvyForms\Controllers\GoogleSheets\GoogleSheetsListWorksheetsController; |
| 49 |
use IvyForms\Controllers\GoogleSheets\GoogleSheetsStatusController; |
| 50 |
use IvyForms\Controllers\GoogleSheets\GoogleSheetsUpdateController; |
| 51 |
use IvyForms\Controllers\GoogleSheets\GoogleSheetsUpdateStatusController; |
| 52 |
use IvyForms\Services\Settings\SettingsService; |
| 53 |
use IvyForms\Services\Usage\UsageTrackingService; |
| 54 |
use IvyForms\Vendor\Melograno\UsageTracker\Collectors\Plugin\IvyFormsCollector; |
| 55 |
|
| 56 |
return [ |
| 57 |
|
| 58 |
MenuManager::class => function ($container) { |
| 59 |
return new MenuManager( |
| 60 |
new MenuService($container->get(RoutePermissionService::class)), |
| 61 |
new MenuMapper($container->get(PermissionResolver::class)) |
| 62 |
); |
| 63 |
}, |
| 64 |
|
| 65 |
PluginInstaller::class => function () { |
| 66 |
return new PluginInstaller(); |
| 67 |
}, |
| 68 |
|
| 69 |
InstallPluginController::class => function ($container) { |
| 70 |
return new InstallPluginController( |
| 71 |
$container->get(PluginInstaller::class) |
| 72 |
); |
| 73 |
}, |
| 74 |
|
| 75 |
IntegrationRegistry::class => function () { |
| 76 |
return new IntegrationRegistry(); |
| 77 |
}, |
| 78 |
|
| 79 |
IntegrationService::class => function ($container) { |
| 80 |
return new IntegrationService( |
| 81 |
$container->get(IntegrationRegistry::class), |
| 82 |
$container->get(\IvyForms\Services\GoogleSheets\Hooks\InitializationHook::class) |
| 83 |
); |
| 84 |
}, |
| 85 |
SubmissionDataFormatterService::class => function () { |
| 86 |
return new SubmissionDataFormatterService(); |
| 87 |
}, |
| 88 |
|
| 89 |
SubmissionUploadService::class => function () { |
| 90 |
return new SubmissionUploadService(); |
| 91 |
}, |
| 92 |
|
| 93 |
FormSubmissionService::class => function ($container) { |
| 94 |
return new FormSubmissionService( |
| 95 |
$container->get(SubmissionUploadService::class), |
| 96 |
$container->get(FormService::class), |
| 97 |
$container->get(FieldService::class), |
| 98 |
$container->get(FieldDuplicateValidationService::class), |
| 99 |
$container->get(SecurityService::class), |
| 100 |
$container->get(EntryService::class), |
| 101 |
$container->get(NotificationService::class), |
| 102 |
$container->get(MailerService::class), |
| 103 |
$container->get(ConfirmationService::class) |
| 104 |
); |
| 105 |
}, |
| 106 |
|
| 107 |
GoogleSheetsRequestSanitizer::class => static function () { |
| 108 |
return new GoogleSheetsRequestSanitizer(); |
| 109 |
}, |
| 110 |
|
| 111 |
GoogleSheetsService::class => static function ($container) { |
| 112 |
return new GoogleSheetsService( |
| 113 |
$container->get(SettingsService::class) |
| 114 |
); |
| 115 |
}, |
| 116 |
|
| 117 |
GoogleSheetsManagerService::class => static function ($container) { |
| 118 |
return new GoogleSheetsManagerService( |
| 119 |
$container->get(GoogleSheetsRepositoryInterface::class) |
| 120 |
); |
| 121 |
}, |
| 122 |
|
| 123 |
GoogleSheetsDispatcherService::class => static function ($container) { |
| 124 |
return new GoogleSheetsDispatcherService( |
| 125 |
$container->get(GoogleSheetsRepositoryInterface::class), |
| 126 |
$container->get(GoogleSheetsService::class), |
| 127 |
$container->get(SubmissionDataFormatterService::class) |
| 128 |
); |
| 129 |
}, |
| 130 |
|
| 131 |
GoogleSheetsEntryHooks::class => static function ($container) { |
| 132 |
return new GoogleSheetsEntryHooks( |
| 133 |
$container->get(GoogleSheetsDispatcherService::class) |
| 134 |
); |
| 135 |
}, |
| 136 |
|
| 137 |
GoogleSheetsFormHooks::class => static function ($container) { |
| 138 |
return new GoogleSheetsFormHooks( |
| 139 |
$container->get(GoogleSheetsRepositoryInterface::class) |
| 140 |
); |
| 141 |
}, |
| 142 |
|
| 143 |
GoogleSheetsInitializationHook::class => static function ($container) { |
| 144 |
return new GoogleSheetsInitializationHook( |
| 145 |
$container->get(SettingsService::class) |
| 146 |
); |
| 147 |
}, |
| 148 |
|
| 149 |
GoogleSheetsConnectController::class => static function ($container) { |
| 150 |
return new GoogleSheetsConnectController( |
| 151 |
$container->get(GoogleSheetsService::class) |
| 152 |
); |
| 153 |
}, |
| 154 |
|
| 155 |
GoogleSheetsOAuthCallbackController::class => static function ($container) { |
| 156 |
return new GoogleSheetsOAuthCallbackController( |
| 157 |
$container->get(GoogleSheetsService::class) |
| 158 |
); |
| 159 |
}, |
| 160 |
|
| 161 |
GoogleSheetsDisconnectController::class => static function ($container) { |
| 162 |
return new GoogleSheetsDisconnectController( |
| 163 |
$container->get(GoogleSheetsService::class) |
| 164 |
); |
| 165 |
}, |
| 166 |
|
| 167 |
GoogleSheetsStatusController::class => static function ($container) { |
| 168 |
return new GoogleSheetsStatusController( |
| 169 |
$container->get(GoogleSheetsService::class) |
| 170 |
); |
| 171 |
}, |
| 172 |
|
| 173 |
GoogleSheetsListSpreadsheetsController::class => static function ($container) { |
| 174 |
return new GoogleSheetsListSpreadsheetsController( |
| 175 |
$container->get(GoogleSheetsService::class) |
| 176 |
); |
| 177 |
}, |
| 178 |
|
| 179 |
GoogleSheetsListWorksheetsController::class => static function ($container) { |
| 180 |
return new GoogleSheetsListWorksheetsController( |
| 181 |
$container->get(GoogleSheetsService::class) |
| 182 |
); |
| 183 |
}, |
| 184 |
|
| 185 |
GoogleSheetsListColumnsController::class => static function ($container) { |
| 186 |
return new GoogleSheetsListColumnsController( |
| 187 |
$container->get(GoogleSheetsService::class) |
| 188 |
); |
| 189 |
}, |
| 190 |
|
| 191 |
GoogleSheetsListIntegrationsController::class => static function ($container) { |
| 192 |
return new GoogleSheetsListIntegrationsController( |
| 193 |
$container->get(GoogleSheetsManagerService::class) |
| 194 |
); |
| 195 |
}, |
| 196 |
|
| 197 |
GoogleSheetsCreateController::class => static function ($container) { |
| 198 |
return new GoogleSheetsCreateController( |
| 199 |
$container->get(GoogleSheetsManagerService::class), |
| 200 |
$container->get(GoogleSheetsRequestSanitizer::class) |
| 201 |
); |
| 202 |
}, |
| 203 |
|
| 204 |
GoogleSheetsUpdateController::class => static function ($container) { |
| 205 |
return new GoogleSheetsUpdateController( |
| 206 |
$container->get(GoogleSheetsManagerService::class), |
| 207 |
$container->get(GoogleSheetsRequestSanitizer::class) |
| 208 |
); |
| 209 |
}, |
| 210 |
|
| 211 |
GoogleSheetsUpdateStatusController::class => static function ($container) { |
| 212 |
return new GoogleSheetsUpdateStatusController( |
| 213 |
$container->get(GoogleSheetsManagerService::class) |
| 214 |
); |
| 215 |
}, |
| 216 |
|
| 217 |
GoogleSheetsDeleteController::class => static function ($container) { |
| 218 |
return new GoogleSheetsDeleteController( |
| 219 |
$container->get(GoogleSheetsManagerService::class) |
| 220 |
); |
| 221 |
}, |
| 222 |
|
| 223 |
FormImportExportService::class => function ($container) { |
| 224 |
return new FormImportExportService( |
| 225 |
$container->get(FormService::class), |
| 226 |
$container->get(FieldService::class), |
| 227 |
$container->get(NotificationService::class), |
| 228 |
$container->get(ConfirmationService::class), |
| 229 |
$container->get(\IvyForms\Services\Permissions\AccessRulesFormScopeExtender::class) |
| 230 |
); |
| 231 |
}, |
| 232 |
|
| 233 |
ExportFormController::class => function ($container) { |
| 234 |
return new ExportFormController( |
| 235 |
$container->get(FormImportExportService::class), |
| 236 |
$container->get(RoutePermissionService::class) |
| 237 |
); |
| 238 |
}, |
| 239 |
|
| 240 |
ImportFormController::class => function ($container) { |
| 241 |
return new ImportFormController( |
| 242 |
$container->get(FormImportExportService::class) |
| 243 |
); |
| 244 |
}, |
| 245 |
|
| 246 |
IvyFormsCollector::class => function () { |
| 247 |
return new IvyFormsCollector(); |
| 248 |
}, |
| 249 |
|
| 250 |
UsageTrackingService::class => function ($container) { |
| 251 |
return new UsageTrackingService($container->get(IvyFormsCollector::class)); |
| 252 |
}, |
| 253 |
|
| 254 |
// GetAllIntegrationsController::class => function ($container) { |
| 255 |
// return new GetAllIntegrationsController( |
| 256 |
// $container->get(IntegrationRegistry::class) |
| 257 |
// ); |
| 258 |
// }, |
| 259 |
// |
| 260 |
// GetIntegrationController::class => function ($container) { |
| 261 |
// return new GetIntegrationController( |
| 262 |
// $container->get(IntegrationRegistry::class) |
| 263 |
// ); |
| 264 |
// }, |
| 265 |
]; |
| 266 |
|