IFactory.php 590 B

123456789101112131415161718192021222324252627282930
  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 OCP\Security\Ip;
  8. /**
  9. * @since 30.0.0
  10. */
  11. interface IFactory {
  12. /**
  13. * Creates a range from string
  14. *
  15. * @since 30.0.0
  16. * @throws \InvalidArgumentException on invalid range
  17. */
  18. public function rangeFromString(string $range): IRange;
  19. /**
  20. * Creates a address from string
  21. *
  22. * @since 30.0.0
  23. * @throws \InvalidArgumentException on invalid IP
  24. */
  25. public function addressFromString(string $ip): IAddress;
  26. }