HostInterface.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. * League.Uri (https://uri.thephpleague.com)
  4. *
  5. * (c) Ignace Nyamagana Butera <nyamsprod@gmail.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. declare(strict_types=1);
  11. namespace League\Uri\Contracts;
  12. /**
  13. * @method string|null encoded() returns RFC3986 encoded host
  14. */
  15. interface HostInterface extends UriComponentInterface
  16. {
  17. /**
  18. * Returns the ascii representation.
  19. */
  20. public function toAscii(): ?string;
  21. /**
  22. * Returns the unicode representation.
  23. */
  24. public function toUnicode(): ?string;
  25. /**
  26. * Returns the IP version.
  27. *
  28. * If the host is a not an IP this method will return null
  29. */
  30. public function getIpVersion(): ?string;
  31. /**
  32. * Returns the IP component If the Host is an IP address.
  33. *
  34. * If the host is a not an IP this method will return null
  35. */
  36. public function getIp(): ?string;
  37. /**
  38. * Tells whether the host is a domain name.
  39. */
  40. public function isDomain(): bool;
  41. /**
  42. * Tells whether the host is an IP Address.
  43. */
  44. public function isIp(): bool;
  45. /**
  46. * Tells whether the host is a registered name.
  47. */
  48. public function isRegisteredName(): bool;
  49. }