PHP 8.3.31
Preview: DomainHostInterface.php Size: 3.20 KB
/home/getspomw/royalsquad.us/vendor/league/uri-interfaces/Contracts/DomainHostInterface.php

<?php

/**
 * League.Uri (https://uri.thephpleague.com)
 *
 * (c) Ignace Nyamagana Butera <nyamsprod@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

declare(strict_types=1);

namespace League\Uri\Contracts;

use Countable;
use Iterator;
use IteratorAggregate;
use League\Uri\Exceptions\SyntaxError;
use Stringable;

/**
 * @extends IteratorAggregate<string>
 */
interface DomainHostInterface extends Countable, HostInterface, IteratorAggregate
{
    /**
     * Returns the labels total number.
     */
    public function count(): int;

    /**
     * Iterate over the Domain labels.
     *
     * @return Iterator<string>
     */
    public function getIterator(): Iterator;

    /**
     * Retrieves a single host label.
     *
     * If the label offset has not been set, returns the null value.
     */
    public function get(int $offset): ?string;

    /**
     * Returns the associated key for a specific label or all the keys.
     *
     * @return int[]
     */
    public function keys(?string $label = null): array;

    /**
     * Tells whether the domain is absolute.
     */
    public function isAbsolute(): bool;

    /**
     * Prepends a label to the host.
     */
    public function prepend(Stringable|string $label): self;

    /**
     * Appends a label to the host.
     */
    public function append(Stringable|string $label): self;

    /**
     * Extracts a slice of $length elements starting at position $offset from the host.
     *
     * This method MUST retain the state of the current instance, and return
     * an instance that contains the selected slice.
     *
     * If $length is null it returns all elements from $offset to the end of the Domain.
     */
    public function slice(int $offset, ?int $length = null): self;

    /**
     * Returns an instance with its Root label.
     *
     * @see https://tools.ietf.org/html/rfc3986#section-3.2.2
     */
    public function withRootLabel(): self;

    /**
     * Returns an instance without its Root label.
     *
     * @see https://tools.ietf.org/html/rfc3986#section-3.2.2
     */
    public function withoutRootLabel(): self;

    /**
     * Returns an instance with the modified label.
     *
     * This method MUST retain the state of the current instance, and return
     * an instance that contains the new label
     *
     * If $key is non-negative, the added label will be the label at $key position from the start.
     * If $key is negative, the added label will be the label at $key position from the end.
     *
     * @throws SyntaxError If the key is invalid
     */
    public function withLabel(int $key, Stringable|string $label): self;

    /**
     * Returns an instance without the specified label.
     *
     * This method MUST retain the state of the current instance, and return
     * an instance that contains the modified component
     *
     * If $key is non-negative, the removed label will be the label at $key position from the start.
     * If $key is negative, the removed label will be the label at $key position from the end.
     *
     * @throws SyntaxError If the key is invalid
     */
    public function withoutLabel(int ...$keys): self;
}

Directory Contents

Dirs: 0 × Files: 16

Name Size Perms Modified Actions
2.98 KB lrw-rw-rw- 2025-09-17 06:53:04
Edit Download
2.69 KB lrw-rw-rw- 2025-09-17 06:53:04
Edit Download
3.20 KB lrw-rw-rw- 2025-09-17 06:53:04
Edit Download
13.81 KB lrw-r--r-- 2026-04-26 10:02:09
Edit Download
461 B lrw-rw-rw- 2025-09-17 06:53:04
Edit Download
1.20 KB lrw-rw-rw- 2025-09-17 06:53:04
Edit Download
1.18 KB lrw-rw-rw- 2025-09-17 06:53:04
Edit Download
2.80 KB lrw-rw-rw- 2025-09-17 06:53:04
Edit Download
470 B lrw-rw-rw- 2025-09-17 06:53:04
Edit Download
8.72 KB lrw-rw-rw- 2025-09-17 06:53:04
Edit Download
4.39 KB lrw-rw-rw- 2025-09-17 06:53:04
Edit Download
578 B lrw-rw-rw- 2025-09-17 06:53:04
Edit Download
2.39 KB lrw-rw-rw- 2025-09-17 06:53:04
Edit Download
367 B lrw-rw-rw- 2025-09-17 06:53:04
Edit Download
11.35 KB lrw-rw-rw- 2025-09-17 06:53:04
Edit Download
1.76 KB lrw-rw-rw- 2025-09-17 06:53:04
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).