pixelfederation/swoole-bundle

View on GitHub
src/Server/Configurator/CallableChainConfigurator.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

declare(strict_types=1);

namespace K911\Swoole\Server\Configurator;

use Swoole\Http\Server;

final class CallableChainConfigurator implements ConfiguratorInterface
{
    /**
     * @param iterable<callable> $configurators
     */
    public function __construct(private iterable $configurators)
    {
    }

    /**
     * {@inheritdoc}
     */
    public function configure(Server $server): void
    {
        /** @var callable $configurator */
        foreach ($this->configurators as $configurator) {
            $configurator($server);
        }
    }
}