mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-30 19:15:24 +00:00
28 lines
560 B
PHP
28 lines
560 B
PHP
<?php
|
|
|
|
namespace PortableInfobox\Sanitizers;
|
|
|
|
class SanitizerBuilder {
|
|
|
|
/**
|
|
* @desc provide sanitizer for a given node type
|
|
*
|
|
* @param string $type
|
|
* @return NodeSanitizer
|
|
*/
|
|
public static 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();
|
|
}
|
|
}
|
|
}
|