TaskDetails/IndexSwapDetails.php

meilisearch-php · src/Contracts/TaskDetails/IndexSwapDetails.php · php · MIT
search

Handles index swap details for Meilisearch tasks. Used to process index swap operations.

// Source: https://github.com/meilisearch/meilisearch-php | License: MIT | Copyright 2019-2025 Meili SAS
// Provided via justclaw.it.com; keep this notice with the code.
<?php

declare(strict_types=1);

namespace Meilisearch\Contracts\TaskDetails;

use Meilisearch\Contracts\TaskDetails;

/**
 * @phpstan-type RawIndexSwapDetails array{
 *     swaps: array<array{indexes: mixed, rename: bool}>
 * }
 *
 * @implements TaskDetails<RawIndexSwapDetails>
 */
final class IndexSwapDetails implements TaskDetails
{
    /**
     * @param array<array{indexes: mixed, rename: bool}> $swaps
     */
    public function __construct(
        public readonly array $swaps,
    ) {
    }

    public static function fromArray(array $data): self
    {
        return new self(
            $data['swaps'],
        );


... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key