| 1 |
<?php |
| 2 |
|
| 3 |
if (! defined('ABSPATH')) { |
| 4 |
exit; // Exit if accessed directly |
| 5 |
} |
| 6 |
|
| 7 |
use DI\Container; |
| 8 |
use IvyForms\Repository\Field\FieldRepository; |
| 9 |
use IvyForms\Repository\Field\FieldRepositoryInterface; |
| 10 |
use IvyForms\Repository\Form\FormRepository; |
| 11 |
use IvyForms\Repository\Form\FormRepositoryInterface; |
| 12 |
use IvyForms\Repository\Notification\NotificationRepository; |
| 13 |
use IvyForms\Repository\Notification\NotificationRepositoryInterface; |
| 14 |
use IvyForms\Repository\Confirmation\ConfirmationRepository; |
| 15 |
use IvyForms\Repository\Confirmation\ConfirmationRepositoryInterface; |
| 16 |
use IvyForms\Services\InstallActions\DB\Field\FieldsTable; |
| 17 |
use IvyForms\Services\InstallActions\DB\Form\FormsTable; |
| 18 |
use IvyForms\Services\InstallActions\DB\Notification\NotificationsTable; |
| 19 |
use IvyForms\Services\InstallActions\DB\Confirmation\ConfirmationsTable; |
| 20 |
|
| 21 |
/** @var Container $container */ |
| 22 |
// @phpstan-ignore-next-line |
| 23 |
$container->set(FormRepositoryInterface::class, static function () { |
| 24 |
return new FormRepository(FormsTable::getTableName()); |
| 25 |
}); |
| 26 |
|
| 27 |
// @phpstan-ignore class.notFound |
| 28 |
$container->set(FieldRepositoryInterface::class, static function () { |
| 29 |
return new FieldRepository(FieldsTable::getTableName()); |
| 30 |
}); |
| 31 |
|
| 32 |
// @phpstan-ignore class.notFound |
| 33 |
$container->set(NotificationRepositoryInterface::class, static function () { |
| 34 |
return new NotificationRepository(NotificationsTable::getTableName()); |
| 35 |
}); |
| 36 |
|
| 37 |
// @phpstan-ignore class.notFound |
| 38 |
$container->set(ConfirmationRepositoryInterface::class, static function () { |
| 39 |
return new ConfirmationRepository(ConfirmationsTable::getTableName()); |
| 40 |
}); |
| 41 |
|