protected function setFilenameOption($filename): void
    {
        if (is_string($filename)) {
            $filename = new BasicFilename($filename);
        }

        if (!is_callable($filename)) {
            throw new TypeError("Filename should be a string or callable");
        }

        $this->filename = $filename;
    }