Factory.php 494 B

1234567891011121314151617181920212223
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OC\Security\Ip;
  8. use OCP\Security\Ip\IAddress;
  9. use OCP\Security\Ip\IFactory;
  10. use OCP\Security\Ip\IRange;
  11. class Factory implements IFactory {
  12. public function rangeFromString(string $range): IRange {
  13. return new Range($range);
  14. }
  15. public function addressFromString(string $ip): IAddress {
  16. return new Address($ip);
  17. }
  18. }