<?php declare(strict_types=1);

namespace Newland\NeosFiltering\ViewHelpers;

use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractConditionViewHelper;

class IfNullViewHelper extends AbstractConditionViewHelper
{

    public function initializeArguments(): void
    {
        $this->registerArgument('value', 'mixed', 'The value to check', true);
        parent::initializeArguments();
    }

    public static function verdict(array $arguments, RenderingContextInterface $renderingContext): bool
    {
        return $arguments['value'] === null;
    }
}
