Closed Ioni14 closed 5 years ago
I added the possibility to chain the SanitizerBuilder methods like the classical Builder pattern.
This can enhance readability. For example:
public static function sanitize($html) { return (new SanitizerBuilder()) ->registerExtension(new BasicExtension()) ->registerExtension(new ListExtension()) ->registerExtension(new CodeExtension()) ->registerExtension(new TableExtension()) ->registerExtension(new IframeExtension()) ->registerExtension(new DetailsExtension()) ->registerExtension(new ExtraExtension()) ->registerExtension(new BpmExtension()) ->build(self::SANITIZER_CONFIG) ->sanitize($html); }
I also added the ext-intl in the composer.json require, the tests failed because I had not this extension.
ext-intl
composer.json
require
That's a great idea, thank you :) .
I added the possibility to chain the SanitizerBuilder methods like the classical Builder pattern.
This can enhance readability. For example:
I also added the
ext-intl
in thecomposer.json
require
, the tests failed because I had not this extension.