I would propose you split your SDImportData into smaller parts which would allow at a later point to import json without having the change the whole parser class.
$csvDataReder = new CsvDataRender(); // Handling of csv specifc data
$dataAnnotator = new DataAnnotator() // Create smw annotation
$dataImportParserFunction = new DataImportParserFunction( $csvDataReder, $dataAnnotator );
$dataImportParserFunction->parse( ... )
You can see [0] how to use injection in a parser function that splits responsibilities and make the code a bit easier to maintain and understood.
[0] https://github.com/SemanticMediaWiki/SemanticInterlanguageLinks/blob/master/src/ParserFunctionFactory.php#L26
I would propose you split your
SDImportDatainto smaller parts which would allow at a later point to importjsonwithout having the change the whole parser class.You can see [0] how to use injection in a parser function that splits responsibilities and make the code a bit easier to maintain and understood.
[0] https://github.com/SemanticMediaWiki/SemanticInterlanguageLinks/blob/master/src/ParserFunctionFactory.php#L26