Skip to content

Commit

Permalink
TexyFilters: remove unnecessary type cast
Browse files Browse the repository at this point in the history
  • Loading branch information
xificurk committed Jul 27, 2018
1 parent 3506704 commit 9e94ae5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Bridges/TexyLatte/TexyFilters.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(TexyMultiplier $texyMultiplier)
public function process(FilterInfo $filterInfo, string $text, bool $singleLine = false): string
{
if (!in_array($filterInfo->contentType, [null, Engine::CONTENT_TEXT, Engine::CONTENT_HTML, Engine::CONTENT_XHTML, Engine::CONTENT_XML], true)) {
trigger_error('Filter |texy used with incompatible type ' . strtoupper((string) $filterInfo->contentType), E_USER_WARNING);
trigger_error('Filter |texy used with incompatible type ' . strtoupper($filterInfo->contentType), E_USER_WARNING);
}

$filterInfo->contentType = ($this->texyMultiplier->getOutputMode() & Texy::XML) !== 0 ? Engine::CONTENT_XHTML : Engine::CONTENT_HTML;
Expand All @@ -35,7 +35,7 @@ public function process(FilterInfo $filterInfo, string $text, bool $singleLine =
public function processLine(FilterInfo $filterInfo, string $text): string
{
if (!in_array($filterInfo->contentType, [null, Engine::CONTENT_TEXT, Engine::CONTENT_HTML, Engine::CONTENT_XHTML, Engine::CONTENT_XML], true)) {
trigger_error('Filter |texyLine used with incompatible type ' . strtoupper((string) $filterInfo->contentType), E_USER_WARNING);
trigger_error('Filter |texyLine used with incompatible type ' . strtoupper($filterInfo->contentType), E_USER_WARNING);
}

$filterInfo->contentType = ($this->texyMultiplier->getOutputMode() & Texy::XML) !== 0 ? Engine::CONTENT_XHTML : Engine::CONTENT_HTML;
Expand All @@ -45,7 +45,7 @@ public function processLine(FilterInfo $filterInfo, string $text): string
public function processTypo(FilterInfo $filterInfo, string $text): string
{
if (!in_array($filterInfo->contentType, [null, Engine::CONTENT_TEXT, Engine::CONTENT_HTML, Engine::CONTENT_XHTML, Engine::CONTENT_XML], true)) {
trigger_error('Filter |texyTypo used with incompatible type ' . strtoupper((string) $filterInfo->contentType), E_USER_WARNING);
trigger_error('Filter |texyTypo used with incompatible type ' . strtoupper($filterInfo->contentType), E_USER_WARNING);
}

return $this->texyMultiplier->processTypo($text);
Expand Down

0 comments on commit 9e94ae5

Please sign in to comment.