Skip to content

Commit

Permalink
fix getTagModel return type
Browse files Browse the repository at this point in the history
  • Loading branch information
ericges committed Mar 12, 2024
1 parent 37d5ffa commit 0b9e989
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Util/FormatterUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Contao\DataContainer;
use Contao\Date;
use Contao\Environment;
use Contao\Model;
use Contao\StringUtil as Str;
use Contao\System;
use Contao\Validator;
Expand Down Expand Up @@ -168,7 +169,7 @@ function (array|string|null $v) use (
}
}

if ($inputType === 'cfgTags' && $tagModel = $this->getTagModel())
if ($inputType === 'cfgTags' && ($tagModel = $this->getTagModel()))
{
$collection = $tagModel->findBy(['source=?', 'id = ?'], [$data['eval']['tagsManager'], $value]);
$value = null;
Expand Down Expand Up @@ -242,7 +243,7 @@ private function prepareServices(): array
return [$system, $controller];
}

private function getTagModel(): ?TagModel
private function getTagModel(): ?Model
{
if (class_exists(TagModel::class)) {
return $this->framework->getAdapter(TagModel::class);
Expand Down

0 comments on commit 0b9e989

Please sign in to comment.