Allow heading tags (h1-h6) in ContentSanitizer so news editor headings render
This commit is contained in:
28
app/Services/Enhance/EnhanceProcessorFactory.php
Normal file
28
app/Services/Enhance/EnhanceProcessorFactory.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Services\Enhance;
|
||||
|
||||
use App\Models\EnhanceJob;
|
||||
use App\Services\Enhance\Processors\ExternalWorkerEnhanceProcessor;
|
||||
use App\Services\Enhance\Processors\StubEnhanceProcessor;
|
||||
use RuntimeException;
|
||||
|
||||
final class EnhanceProcessorFactory
|
||||
{
|
||||
public function __construct(
|
||||
private readonly StubEnhanceProcessor $stubProcessor,
|
||||
private readonly ExternalWorkerEnhanceProcessor $externalWorkerProcessor,
|
||||
) {
|
||||
}
|
||||
|
||||
public function make(string $engine): EnhanceProcessor
|
||||
{
|
||||
return match ($engine) {
|
||||
EnhanceJob::ENGINE_STUB => $this->stubProcessor,
|
||||
EnhanceJob::ENGINE_EXTERNAL_WORKER => $this->externalWorkerProcessor,
|
||||
default => throw new RuntimeException('Unknown enhance processor engine.'),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user