<?php

declare(strict_types=1);

namespace apexl\Io\modules\validation\Collections;

use apexl\Io\modules\validation\Interfaces\HasValidationRulesInterface;
use Arrayy\Collection\AbstractCollection;

final class ValidationRuleCollectionCollection extends AbstractCollection implements HasValidationRulesInterface
{
    public function getType(): string
    {
        return ValidationRuleCollection::class;
    }

    public function forValidator(): array
    {
        return $this->map(function (ValidationRuleCollection $collection) {
            return $collection->toValidationString();
        })->toArray();
    }

    public function getValidationRules(ValidationRuleCollectionCollection $rules): ValidationRuleCollectionCollection
    {
        return $this;
    }
}