Files

23 lines
459 B
PHP
Raw Permalink Normal View History

<?php
namespace App\Support\VideoWorkflow\StepHandlers;
class StepHandlerManager
{
/**
* @param array<StepHandler> $handlers
*/
public function __construct(private readonly array $handlers) {}
public function resolve(string $type): ?StepHandler
{
foreach ($this->handlers as $handler) {
if ($handler->type() === $type) {
return $handler;
}
}
return null;
}
}