File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,10 @@ final class BBCode
1212
1313 const CASE_SENSITIVE = 0 ;
1414
15- public function __construct ()
15+ public function __construct ($ htmlParsers = null , $ bbCodeParsers = null )
1616 {
17- $ this ->htmlParser = new HTMLParser ();
18- $ this ->bbCodeParser = new BBCodeParser ();
17+ $ this ->htmlParser = new HTMLParser ($ htmlParsers );
18+ $ this ->bbCodeParser = new BBCodeParser ($ bbCodeParsers );
1919 }
2020
2121 public function only ($ only = null )
Original file line number Diff line number Diff line change @@ -12,6 +12,11 @@ class Parser
1212
1313 protected $ parsers = [];
1414
15+ public function __construct ($ parsers = null )
16+ {
17+ $ this ->parsers = $ parsers === null ? $ this ->parsers : $ parsers ;
18+ }
19+
1520 protected function searchAndReplace (string $ pattern , string $ replace , string $ source ): string
1621 {
1722 while (preg_match ($ pattern , $ source )) {
You can’t perform that action at this time.
0 commit comments