EventSourceFactory.php 462 B

12345678910111213141516171819202122232425
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OC;
  8. use OCP\IEventSource;
  9. use OCP\IEventSourceFactory;
  10. use OCP\IRequest;
  11. class EventSourceFactory implements IEventSourceFactory {
  12. public function __construct(
  13. private IRequest $request,
  14. ) {
  15. }
  16. public function create(): IEventSource {
  17. return new EventSource($this->request);
  18. }
  19. }