Files
2026-04-28 21:14:25 +03:00

30 lines
816 B
PHP

<?php
namespace App\Services\TpCreator\DocumentProcessors;
use Exception;
class TpDocumentProcessorFactory
{
public static function make(string $type, string $path): AbstractTpDocumentProcessor
{
// Path based detection logic first (as in blade/service)
if (strpos($path, "NDT_Clearance") !== false) {
return new NdtClearanceTpProcessor();
}
switch ($type) {
case 'qa':
return new QaTpProcessor();
case 'wdb':
return new WdbTpProcessor();
case 'drawings':
return new DrawingsTpProcessor();
case 'document-procedure':
return new DocumentProcedureTpProcessor();
default:
return new GenericTpProcessor();
}
}
}