'onInitGoogleCalendarClientFactory', 'GoogleSyncGateway' => 'onInitGoogleSyncEntryGateway', 'GoogleSyncService' => 'onInitGoogleSyncEntryService', 'GoogleEventConverter' => 'onInitGoogleEventConverter', 'GoogleCalendarSynchronizer' => 'onInitGoogleCalendarSynchronizer', ]; } /** * @param ContainerInterface $container * * @return GoogleCalendarClientFactory */ public static function onInitGoogleCalendarClientFactory(ContainerInterface $container): GoogleCalendarClientFactory { return new GoogleCalendarClientFactory( $container->get('GoogleApiClientFactory'), $container->get('GoogleAccountGateway') ); } /** * @param ContainerInterface $container * * @return GoogleSyncGateway */ public static function onInitGoogleSyncEntryGateway(ContainerInterface $container): GoogleSyncGateway { return new GoogleSyncGateway( $container->get('Database') ); } /** * @param ContainerInterface $container * * @return GoogleSyncService */ public static function onInitGoogleSyncEntryService(ContainerInterface $container): GoogleSyncService { return new GoogleSyncService( $container->get('Database'), $container->get('GoogleSyncGateway') ); } /** * @param ContainerInterface $container * * @return GoogleEventConverter */ public static function onInitGoogleEventConverter(ContainerInterface $container): GoogleEventConverter { return new GoogleEventConverter( self::onInitUserAddressGatewayWrapper($container) ); } /** * @param ContainerInterface $container * * @return GoogleCalendarSynchronizer */ public static function onInitGoogleCalendarSynchronizer(ContainerInterface $container): GoogleCalendarSynchronizer { return new GoogleCalendarSynchronizer( $container->get('GoogleSyncGateway'), $container->get('GoogleSyncService'), $container->get('CalendarService'), $container->get('GoogleEventConverter'), self::onInitUserAddressGatewayWrapper($container), $container->get('UserConfigService') ); } /** * @param ContainerInterface $container * * @return UserAddressGatewayWrapper */ private static function onInitUserAddressGatewayWrapper(ContainerInterface $container): UserAddressGatewayWrapper { return new UserAddressGatewayWrapper($container->get('Database')); } }