ApiFactory.php 651 B

123456789101112131415161718192021222324
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OC\Remote\Api;
  7. use OCP\Http\Client\IClientService;
  8. use OCP\Remote\Api\IApiFactory;
  9. use OCP\Remote\ICredentials;
  10. use OCP\Remote\IInstance;
  11. class ApiFactory implements IApiFactory {
  12. /** @var IClientService */
  13. private $clientService;
  14. public function __construct(IClientService $clientService) {
  15. $this->clientService = $clientService;
  16. }
  17. public function getApiCollection(IInstance $instance, ICredentials $credentials) {
  18. return new ApiCollection($instance, $credentials, $this->clientService);
  19. }
  20. }