Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #32 from Ioni14/master
Browse files Browse the repository at this point in the history
set fluent the SanitizerBuilder methods
  • Loading branch information
tgalopin authored Oct 24, 2019
2 parents 858f83a + ea90834 commit 8ca76a6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"require": {
"php": ">=7.1",
"ext-dom": "*",
"ext-intl": "*",
"masterminds/html5": "^2.4",
"psr/log": "^1.0",
"league/uri-parser": "^1.4.1"
Expand Down
6 changes: 6 additions & 0 deletions src/SanitizerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,22 @@ class SanitizerBuilder implements SanitizerBuilderInterface
public function registerExtension(ExtensionInterface $extension)
{
$this->extensions[$extension->getName()] = $extension;

return $this;
}

public function setParser(?ParserInterface $parser)
{
$this->parser = $parser;

return $this;
}

public function setLogger(?LoggerInterface $logger)
{
$this->logger = $logger;

return $this;
}

public function build(array $config): SanitizerInterface
Expand Down
2 changes: 2 additions & 0 deletions src/SanitizerBuilderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ interface SanitizerBuilderInterface
* Register an extension to use in the sanitizer being built.
*
* @param ExtensionInterface $extension
*
* @return SanitizerBuilderInterface
*/
public function registerExtension(ExtensionInterface $extension);

Expand Down

0 comments on commit 8ca76a6

Please sign in to comment.