mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-12-12 16:45:21 +00:00
26 lines
514 B
PHP
26 lines
514 B
PHP
|
<?php
|
||
|
|
||
|
class SanitizerBuilder {
|
||
|
|
||
|
/**
|
||
|
* @desc provide sanitizer for a given node type
|
||
|
*
|
||
|
* @param $type
|
||
|
* @return NodeSanitizer
|
||
|
*/
|
||
|
static public function createFromType( $type ) {
|
||
|
switch ( $type ) {
|
||
|
case 'data':
|
||
|
return new NodeDataSanitizer();
|
||
|
case 'horizontal-group-content':
|
||
|
return new NodeHorizontalGroupSanitizer();
|
||
|
case 'title':
|
||
|
return new NodeTitleSanitizer();
|
||
|
case 'image':
|
||
|
return new NodeImageSanitizer();
|
||
|
default:
|
||
|
return new PassThroughSanitizer();
|
||
|
}
|
||
|
}
|
||
|
}
|