Files
muninn/app/Support/VideoWorkflow/StepHandlers/StepHandlerManager.php
T

23 lines
459 B
PHP
Raw 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;
}
}