idealo/php-rdkafka-ffi

View on GitHub
src/RdKafka/Metadata/Topic.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php

declare(strict_types=1);

namespace RdKafka\Metadata;

class Topic
{
    private string $topic;
    private Collection $partitions;
    private int $err;

    public function __construct(string $topic, Collection $partitions, int $err)
    {
        $this->topic = $topic;
        $this->partitions = $partitions;
        $this->err = $err;
    }

    public function getTopic(): string
    {
        return $this->topic;
    }

    /**
     * @return Collection|Partition[]
     */
    public function getPartitions(): Collection
    {
        return $this->partitions;
    }

    public function getErr(): int
    {
        return $this->err;
    }
}