Skip to content

Commit

Permalink
[TASK] Postpone Sanitizer deprecations (#100)
Browse files Browse the repository at this point in the history
Postpone deprecation messages after v2.1.0 release.

Fixes: #99
  • Loading branch information
ohader authored Dec 5, 2022
1 parent 703dded commit 2f195f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/Sanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,6 @@ public function __construct(...$items)
}
}
$this->parser = $this->createParser();

if (!$this->behavior instanceof Behavior) {
trigger_error(
'Add `Behavior` when creating new `Sanitizer` instances, e.g. `new Sanitizer($behavior, $visitor)`',
E_USER_DEPRECATED
);
}
}

public function sanitize(string $html, InitiatorInterface $initiator = null): string
Expand Down
2 changes: 2 additions & 0 deletions tests/ScenarioTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class ScenarioTest extends TestCase
*/
public function missingBehaviorTriggersDeprecationError(): void
{
$this->markTestSkipped('see https://github.com/TYPO3/html-sanitizer/issues/99');

$this->expectDeprecation();
$this->expectDeprecationMessage(
'Add `Behavior` when creating new `Sanitizer` instances, e.g. `new Sanitizer($behavior, $visitor)`'
Expand Down

0 comments on commit 2f195f5

Please sign in to comment.